What will be the output of calling a method overridden in the child class?

  • It depends on how the method is called
  • It depends on the method's signature
  • The child class's method will always be called
  • The parent class's method will always be called
When a method is overridden in the child class, the version of the method in the child class is called when the method is invoked on an instance of the child class. This is known as method overriding and is a fundamental concept in object-oriented programming.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *