InheritanceInheritance is specific to object-oriented programming, where a new class is created from an existing class. Inheritance (often referred to as subclasses) comes from the fact that the subclass (the newly created class) contains the attributes and methods of the parent class. The main advantage of inheritance is the ability to define new attributes and new methods for the subclass which are then applied to the inherited attributes and methods.A class that is used as the basis for inheritance is called a superclass or base class. A class that inherits from a superclass is called a subclass or derived class. The terms parent class and child class are also acceptable terms to use respectively. A child inherits visible properties and methods from its parent while adding additional properties and methods of its own. In this section, we'll discuss more about:: 9.1 Java Class Inheritance
9.2 Is-A Relationship In Java
9.3 Passing Sub Class Object As Super Class Reference
9.4 Assigning Sub Class Object To Super Class Reference In Java
9.5 Assigning Super Class Reference To A Sub Class Reference In Java
9.6 Multilevel Inheritance In Java With Example Program
Dependent Topics : 8. Classes |