Question 12
Back to Exercise
What is a class invariant?
- A A final variable
- B A condition that must be true for every object after construction and after every public method Correct
- C A static field
- D An unchanging method name
Correct Answer: Option B
Example: balance ≥ 0, or min ≤ max.
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!