Composition:

  • It is a form of association where one class contains an instance of another class.
  • Example: A Car class may contain instances of Engine, Wheel, and Battery classes.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *