asked in Inheritance by (58.6k points)

1 Answer

No, you cannot override a static method in Java because it's resolved at compile time. In order for overriding to work, a method should be virtual and resolved at runtime because objects are only available at runtime. This is one of the tricky Java questions, where interviewer tries to confuse you. A programmer is never sure about whether they can override or overload a static method in Java.
answered by (58.6k points)

Java Interview Questions and Answers 2018