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 the reference type, not the actual object type. When you have a parent class reference and assign a child object, calling a static method invokes the parent class version, not the child's.