69.1k views
4 votes
Define inheritance. give an example

1 Answer

0 votes
A class can be defined using another class as a foundation. In object-oriented programming terminology, one class can inherit fi elds and methods from another. An object that inherits from another is called a subclass, and the object it inherits from is called a superclass. A subclass extends the superclass.
User Ryon
by
7.9k points