# Composition

*noun*

say it: **“kom-puh-ZISH-un”** **/ˌkɑmpəˈzɪʃən/**

Building a class from parts: it keeps other objects in its fields and uses them.

## 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();
}
```

## In a sentence

- “Every bike has a lock through **composition**: the lock is a field, not a parent.”

Level: Journeyman · [More OOP terms at this level](https://www.ask-codey.com/glossary?category=oop&level=3)

Updated: November 9, 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
