What is inheritance?

Inheritance is one of the excellent assert of Object-Oriented Programming. It permits a class to utilize the methods and properties  for another class.

The determined class acquires the behavior of the base class. The determined class is likewise called subclass and the base class is otherwise called super-class.

The determined class can include its own particular extra factors and techniques. These extra factors and strategies separates the derived class from the base class.

And Inheritance is a run time system. A super-class can have any number of subclasses. In any case, a subclass can have just a single super class. This is on the grounds that Java does not bolster numerous legacy.


The superclass and subclass have "is-a" connection between them. The following is the syntax.

class classB extends Class A 
{  
   //methods and fields  
}  

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...