Single inheritance:
1)One child class that can access One parent class
2)Parent class-the variables and methods which is created inside the class
3)Child class-the parent class that can be accessed inside the class in
another class
4)The object which is created inside the child class can aceess both
the parent and child class
Hierarichical inheritance:
1)Single parent classs that can be accessed by the multiple child class
2)The object,created in all the multiple child classes can access parent class,when each child class(extends the parent class)
Multiple inheritance:
1)It will occurs ambiquity problem
2)It will shows error at compiling stage
3)It can be overcome by interface concept
Multilevel iheritance:
1)A parent class that access from a another parent class
2)It has a multiple parent class and single child class
1)In this class,the child class can access all the variable and methods of the multiple parent class
Hybrid inheritance:
1)It is a mixture of multilevel and hierarichical inheritance
Polymorphism:
1)A method that act in a multiple form
2)It has a two types
*method overriding
*method overloading
method overriding:
1)A parent class and a child class has a same method name and method argument(method sign)
2)In this sinario,it gives a first preferance the child class(method sign)
method overloading:
1)In a class,multiple methods can have same method name with different
no.argument and different datatype
Top comments (0)