Composition in Java
🟢 Beginner Level | Java Core Syntax
📖 Definition
Composition represents a HAS-A relationship where a class contains instances of other classes as fields rather than extending them.
âš¡ Code Example
public class Computer {
private Processor processor; // HAS-A Processor
}