asked in Inheritance by (58.6k points)

1 Answer

Since the static method cannot be overridden in Java, but if you declare the same static method in subclass then that would hide the method from the superclass. It means, if you call that method from subclass then the one in the subclass will be invoked but if you call the same method from superclass then the one in superclass will be invoked. This is known as method hiding in Java.
answered by (58.6k points)

Java Interview Questions and Answers 2018