The super class,or parent class contains all the attributes and behaviors that are common to classes that inherit from it
eg:
In the case of the Mammals class,all mammals have similar attributes.such as eye color and hair colors,as well as behaviors such as gone rate internal heat and grow hair.so it is not necessary to duplicate then down the inheritance free for each type of mammal
What Is a Class?
ReplyDeleteA class is the blueprint from which individual objects are created.In the real world, We'll often find many individual objects all of the same kind. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles.
A superclass provides data (instance variables) and functions (methdods) to be inherited by the subclass. Typically, subclasses and superclasses are related in a generalization-specialization relationship: The subclass is-a specialization of the superclass.
ReplyDelete