What is inheritance in Java?
Inheritance in Java is a mechanism where one class acquires the properties and behaviors (methods) of another class. It is a key feature of object-oriented programming.
Exactly! You've correctly explained inheritance as a way to reuse code from another class.
Can you explain what happens when a subclass overrides a method from the superclass?