Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

3

Share

Composition in OOP

A very simple concept of Composition in OOP(Object-Oriented Programming) using C++ programming lanuguage.
if you have any Question Regarding this PPt..
leave your message in comment box.
Thank you.. :)

Related Books

Free with a 30 day trial from Scribd

See all

Composition in OOP

  1. 1. Composition in OOP Presented by Huba Akhtar
  2. 2. Definition:Definition:
  3. 3. What is Composition?What is Composition?
  4. 4. Lets Suppose:Lets Suppose: Let's say we must manage rooms in a hotel. We will have a class Hotel that has several objects Floor. And each floor is composed of several Rooms. Using "is composed" give us a hint on the relationship between Floor and Room.
  5. 5. Continue…Continue… If we happen to destroy the object Floor, what should happen to the Rooms?? If a Floor is destroy then all the Rooms inside should also be destroy. That is aThat is a compositioncomposition
  6. 6. Example:Example: For Example, you could have a class called Band. The data member of Band class could consist of objects from the Guitarist, Drummer, and Vocalist classes. These objects are data member of the Band class, but not the parent classes. They are related by composition, not by inheritance.
  • RidhamJain5

    Jun. 25, 2021
  • AwaisKhalid64

    Jun. 3, 2020
  • ShefaIdrees

    Oct. 21, 2017

A very simple concept of Composition in OOP(Object-Oriented Programming) using C++ programming lanuguage. if you have any Question Regarding this PPt.. leave your message in comment box. Thank you.. :)

Views

Total views

5,248

On Slideshare

0

From embeds

0

Number of embeds

0

Actions

Downloads

1

Shares

0

Comments

0

Likes

3

×