Multiple choice technology programming languages

If you have reference variable of parent class type and you assign a child class object to that variable and invoke static method. Which method will be invoked? Parent/Child.

  1. Parent

  2. Child

  3. Both

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Static methods are bound at compile time based on reference type, not actual object type. Parent p = new Child(); p.staticMethod() calls Parent's version. This is because static methods belong to the class, not instances.