From ad76482686564d4b2bdeb1992aa698a7d0549aa3 Mon Sep 17 00:00:00 2001 From: Anna Simko <108935534+Ann1120-ua@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:49:10 -0500 Subject: [PATCH] third try --- src/test/java/core/basesyntax/Bulldozer.java | 6 ++---- src/test/java/core/basesyntax/Excavator.java | 4 ++-- src/test/java/core/basesyntax/Machine.java | 2 +- src/test/java/core/basesyntax/MainAppTest.java | 7 ++++--- src/test/java/core/basesyntax/Truck.java | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/test/java/core/basesyntax/Bulldozer.java b/src/test/java/core/basesyntax/Bulldozer.java index d8c7693fb..9e83aaa71 100644 --- a/src/test/java/core/basesyntax/Bulldozer.java +++ b/src/test/java/core/basesyntax/Bulldozer.java @@ -5,13 +5,11 @@ public class Bulldozer extends Machine { @Override public void doWork() { - System.out.println("core.basesyntax.Bulldozer has started working."); + System.out.println("Bulldozer has started working."); } @Override public void stopWork() { - System.out.println("core.basesyntax.Bulldozer has stopped working."); + System.out.println("Bulldozer has stopped working."); } } - - diff --git a/src/test/java/core/basesyntax/Excavator.java b/src/test/java/core/basesyntax/Excavator.java index 797580138..cfea09cf4 100644 --- a/src/test/java/core/basesyntax/Excavator.java +++ b/src/test/java/core/basesyntax/Excavator.java @@ -5,12 +5,12 @@ public class Excavator extends Machine { @Override public void doWork() { - System.out.println("core.basesyntax.Excavator has started working."); + System.out.println("Excavator has started working."); } @Override public void stopWork() { - System.out.println("core.basesyntax.Excavator has stopped working."); + System.out.println("Excavator has stopped working."); } } diff --git a/src/test/java/core/basesyntax/Machine.java b/src/test/java/core/basesyntax/Machine.java index 0f2992054..c76c0d9d4 100644 --- a/src/test/java/core/basesyntax/Machine.java +++ b/src/test/java/core/basesyntax/Machine.java @@ -1,6 +1,6 @@ package core.basesyntax; -abstract class Machine { +public abstract class Machine { public abstract void doWork(); public abstract void stopWork(); } diff --git a/src/test/java/core/basesyntax/MainAppTest.java b/src/test/java/core/basesyntax/MainAppTest.java index 5dcdcd090..dfb69eb6c 100644 --- a/src/test/java/core/basesyntax/MainAppTest.java +++ b/src/test/java/core/basesyntax/MainAppTest.java @@ -2,7 +2,8 @@ public class MainAppTest { public static void main(String[] args) { - Machine[] machines = new Machine[3]; + final int MACHINE_COUNT = 3; + Machine[] machines = new Machine[MACHINE_COUNT]; machines[0] = new Truck(); machines[1] = new Bulldozer(); machines[2] = new Excavator(); @@ -12,6 +13,6 @@ public static void main(String[] args) { machine.doWork(); machine.stopWork(); } - } + } +} -} \ No newline at end of file diff --git a/src/test/java/core/basesyntax/Truck.java b/src/test/java/core/basesyntax/Truck.java index 32589b6cb..b0296531b 100644 --- a/src/test/java/core/basesyntax/Truck.java +++ b/src/test/java/core/basesyntax/Truck.java @@ -3,11 +3,11 @@ public class Truck extends Machine { @Override public void doWork() { - System.out.println("core.basesyntax.Truck has started working."); + System.out.println("Truck has started working."); } @Override public void stopWork() { - System.out.println("core.basesyntax.Truck has stopped working."); + System.out.println("Truck has stopped working."); } }