← Quiz: OOP Interview Questions: all 10 questions
Quiz: OOP Interview Questions · Question 6 of 10
Can a static method be overridden in Java?
Can a static method be overridden in Java?
- A.Yes, like any method
- B.No; a static method with the same signature in a child hides the parent's, with no runtime dispatch
- C.Only if it is final
- D.Only in abstract classes
Answer & explanation
Correct answer: No; a static method with the same signature in a child hides the parent's, with no runtime dispatch
Which static method runs depends on the declared type, not the object.
Can you get the rest right without peeking?
Take the timed Quiz: OOP Interview Questions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →