+ 2
What is the use of ' inherintance ' in java ?
please upvote and comment
2 odpowiedzi
+ 6
Inheritance is the process that enables one class to acquire the properties (methods and variables) of another. With inheritance, the information is placed in a more manageable, hierarchical order.
like making one class and put some methods in it and we need this methods in other class in this case we use inheritance.
+ 3
also You have polymorphism. object have more than one type. it is of his class, parents classes and implemented interfaces by self and parents. with this You can have a list of parent class but with instances of different sub classes