diff --git a/src/main/java/core/basesyntax/Bulldozer.java b/src/main/java/core/basesyntax/Bulldozer.java index 3ad772cf8..3f4afc9fd 100644 --- a/src/main/java/core/basesyntax/Bulldozer.java +++ b/src/main/java/core/basesyntax/Bulldozer.java @@ -1,5 +1,4 @@ package core.basesyntax; - public class Bulldozer extends Machine { @Override public void doWork() { @@ -7,7 +6,6 @@ public void doWork() { } @Override public void stopWork() { - System.out.println("Bulldozer machine stopped its work"); } } diff --git a/src/main/java/core/basesyntax/Excavator.java b/src/main/java/core/basesyntax/Excavator.java index e74f8ea88..81b68d585 100644 --- a/src/main/java/core/basesyntax/Excavator.java +++ b/src/main/java/core/basesyntax/Excavator.java @@ -1,14 +1,11 @@ package core.basesyntax; - public class Excavator extends Machine { @Override public void doWork() { - System.out.println("Excavator machine started its work"); } @Override public void stopWork() { - System.out.println("Excavator machine stopped its work"); } } diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java index b71fc6589..584a9aaeb 100644 --- a/src/main/java/core/basesyntax/Machine.java +++ b/src/main/java/core/basesyntax/Machine.java @@ -1,7 +1,5 @@ package core.basesyntax; - public abstract class Machine { public abstract void doWork(); public abstract void stopWork(); - } diff --git a/src/main/java/core/basesyntax/MainApp.java b/src/main/java/core/basesyntax/MainApp.java index 0224584f2..08edb7fa9 100644 --- a/src/main/java/core/basesyntax/MainApp.java +++ b/src/main/java/core/basesyntax/MainApp.java @@ -1,10 +1,9 @@ package core.basesyntax; - public class MainApp { public static void main(String[] args) { - Truck truck = new Truck(); - Bulldozer bulldozer = new Bulldozer(); - Excavator excavator = new Excavator(); + Machine truck = new Truck(); + Machine bulldozer = new Bulldozer(); + Machine excavator = new Excavator(); Machine[] machines = new Machine[]{truck, bulldozer, excavator}; for (Machine machine : machines) { machine.doWork(); diff --git a/src/main/java/core/basesyntax/Truck.java b/src/main/java/core/basesyntax/Truck.java index 1a758abff..6d21d9147 100644 --- a/src/main/java/core/basesyntax/Truck.java +++ b/src/main/java/core/basesyntax/Truck.java @@ -1,14 +1,11 @@ package core.basesyntax; public class Truck extends Machine { - @Override public void doWork() { - System.out.println("Truck machine started its work"); } @Override public void stopWork() { - System.out.println("Truck machine stopped its work"); } }