What keyword is used to extend a class in Java?

  • extends
  • implements
  • inherits
  • subclass
In Java, the extends keyword is used to indicate inheritance and extend a class. When a class extends another class, it inherits all the members (fields and methods) of the parent class, allowing you to create a subclass that inherits and extends the functionality of the superclass.
Add your answer
Loading...

Leave a comment

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