Discussion
How is generalization implemented in Object Oriented programming languages ?
Answer: A
Generalization is implemented through Inheritance.
Generalization is the is-a relationship: the common attributes and behaviour of several classes are moved up into a more general superclass, as Car and Truck generalise to Vehicle. In code this is written as inheritance, with the specific classes extending the general one.
Polymorphism lets one interface behave differently for different types, and encapsulation hides an object's data behind its methods. Abstract classes are often used as the general class, but the relationship itself is implemented by inheritance.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development