Styrow.dev
Question 32 of 247
Java Topic: General medium

What is Inheritance?

Question

What is Inheritance?

Answer

• Inheritance is the process by which objects of one class acquire the properties of objects of another class. • A class that is inherited is called a superclass. • The class that does the inheriting is called a subclass. • Inheritance is done by using the keyword extends. • The two most common reasons to use inheritance are: To promote code reuse To use polymorphism