Question 15
Back to Exercise
Why is a public setStatus(String) method on an Order risky?
- A Strings are slow
- B Callers could jump to any status (e.g. CREATED to DELIVERED), skipping business rules Correct
- C It cannot be overridden
- D It must be static
Correct Answer: Option B
Expose actions like pay() and ship() instead.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!