Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions oop/java/composition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ class Car {
}

public class CompositionExample {
public static void main(String[] args) {
Engine engine = new Engine(150);
Wheel wheel = new Wheel("Alloy");
Transmission transmission = new Transmission("Automatic");

Car car = new Car(engine, wheel, transmission);
public static void main(String[] args) {
Car car = new Car(new Engine(150), new Wheel("Alloy"), new Transmission("Automatic"));
car.drive();
}
}
Expand Down