A)
->java doesn’t support multiple inheritance.
->super classes are generalized classes. Whereas sub classes are specialized classed.
->the bottom most classes in the hierarchy contain more specialized and the top most classes in the hierarchy contains more generalization.
->super class reference can refer to subclass object.
->As java supports single inheritance. It also supports two special cases of single inheritance
1. Multilevel inheritance.
2. Hierarchical inheritance.
->if a super class has more than one sub classes, it is known as hierarchical inheritance.
Hierarchical inheritance
->if a sub c lass is acting as a super class for another sub class, that form of inheritance is known as multilevel inheritance.
-> Java.long.Object class is super class of all java classes.
-> Sub class objects substitute super class object in the application.
->inheritance provides reusability of code.
Security provided by encapsulation
Comments
Post a Comment