# What is composition in C#?

CsharpProgrammingServer Side Programming

#### CSharp Online Training

59 Lectures 6.5 hours

If the parent object is deleted under Composition, then the child object also loses its status. The composition is a special type of Aggregation and gives a part-of relationship.

For example, A Car has an engine. If the car is destroyed, the engine is destroyed as well.

public class Engine {
. . .
}

public class Car {
Engine eng = new Engine();
.......
}
Updated on 20-Jun-2020 15:54:17