How can you access a method from a base class in a derived class if the method is overridden in the derived class?

  • By redefining the base class method in the derived class
  • By using the 'base' keyword
  • By using the 'super()' function
  • You cannot access the base class method
To access a method from a base class that is overridden in the derived class, you can use the 'super()' function. This allows you to call the base class method explicitly and execute its code alongside the derived class method. It's a common practice when you want to extend the functionality of the base class method in the derived class without completely replacing it.
Add your answer
Loading...

Leave a comment

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