1. Class A method
  2. Class B method
  3. Compilation Error
  4. Runtime Error
  5. None of these

Share with your friends
AhmedNazir

Call

Answer: Option 1

Overriding in Java simply means that the particular method would be called based on the run time type of the object and not on the compile time type. But in the above case the methods are static which means access to them is always resolved during compile time only using the compile time type information. Accessing them using object references is just an extra liberty given by the designers of Java.

Talk Doctor Online in Bissoy App