![]() What is Polymorphism in Java OOPs?Īs the name suggests, it means many forms. The above image shows various inheritances and their syntax. So instead of defining the common properties again, we can only define the distinct properties in the new class and inherit the common properties from the base class. So in addition planes have their distinct attributes like luxury_arrangements, food, and air hostess. All the planes are of the sub-type of class "Plane" and they have common attributes mentioned above. In our example, we created a class "Plane" which contained attributes like plane_number, total_seats, airline_class, and pilot_name.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |