# Composition

Building an object out of other objects it owns ("has-a").

## What is **Composition**?

**Composition** means building an object out of other objects. A `Car` *has an* `Engine` and *has* four `Wheel`s. The parts are usually created and owned by the whole.

```csharp
public class Car
{
    private readonly Engine engine = new();
    private readonly Wheel[] wheels = { new(), new(), new(), new() };

    public void Start() => engine.Start();
}
```

Level: Journeyman · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/journeyman)

Updated: September 27, 2026

## In other subjects

- [Composition in C#](https://www.ask-codey.com/glossary/composition-c-sharp)
- [Composition in Java](https://www.ask-codey.com/glossary/composition)

Source: https://www.ask-codey.com/glossary/composition-oop
