Machine-translated by Google. Questions are authored in English.
Top

Discussion

How is generalization implemented in Object Oriented programming languages ?

  • A.Inheritance
  • B.Polymorphism
  • C.Encapsulation
  • D.Abstract classes

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.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.