In Java, when a subclass has the same method as declared in the parent class, it is known as method ________.

  • hiding
  • inheriting
  • overloading
  • overriding
When a subclass has the same method name, return type, and parameters as declared in the parent class, it is known as method overriding. The subclass provides a specific implementation for that method.
Add your answer
Loading...

Leave a comment

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