Question 18
Back to Exercise
Why is calling an overridable method from a constructor risky?
- A It is a compile error
- B A subclass override may run before the subclass's fields are initialised, so it sees default values Correct
- C It causes infinite recursion
- D The method cannot access fields
Correct Answer: Option B
Make such methods private or final, or avoid the call.
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!