What is aggregation?
Output
Hello
Problem : A Car must has Engine and body.
A Car may or may not has Ac
Adding Ac as an Aggregate object in car
Output:
Engine Start
Saloon Type
Super Cool
Engine Start
Saloon Type
Same with Data Members
E.g A school has one student
- "Have a" or "May have" relationship
- Aggregation is special type of association
- Life time of Component object is independent from its container object
|
Output
Hello
Problem : A Car must has Engine and body.
A Car may or may not has Ac
Adding Ac as an Aggregate object in car
class Engine{
|
Output:
Engine Start
Saloon Type
Super Cool
Engine Start
Saloon Type
Same with Data Members
class Engine{
Output:
Engine Power 800Saloon Size 5 Car Price 1000
Super Cool with price =1000 |
Comments
Post a Comment