From 7b5a73b2d08c7ad2913c484006f51d47483408d6 Mon Sep 17 00:00:00 2001 From: Roman Leshchyshyn Date: Fri, 11 Oct 2024 16:08:57 +0300 Subject: [PATCH 1/5] hi --- src/main/java/core/basesyntax/Bulldozer.java | 12 +++++ src/main/java/core/basesyntax/Excavator.java | 12 +++++ src/main/java/core/basesyntax/Machine.java | 10 ++++ src/main/java/core/basesyntax/MainApp.java | 7 +++ src/main/java/core/basesyntax/Truck.java | 12 +++++ untitled/.idea/vcs.xml | 6 +++ untitled/.idea/workspace.xml | 52 ++++++++++++++++++++ 7 files changed, 111 insertions(+) create mode 100644 src/main/java/core/basesyntax/Bulldozer.java create mode 100644 src/main/java/core/basesyntax/Excavator.java create mode 100644 src/main/java/core/basesyntax/Machine.java create mode 100644 src/main/java/core/basesyntax/Truck.java create mode 100644 untitled/.idea/vcs.xml create mode 100644 untitled/.idea/workspace.xml diff --git a/src/main/java/core/basesyntax/Bulldozer.java b/src/main/java/core/basesyntax/Bulldozer.java new file mode 100644 index 000000000..b21f8ba96 --- /dev/null +++ b/src/main/java/core/basesyntax/Bulldozer.java @@ -0,0 +1,12 @@ +package core.basesyntax; + +public class Bulldozer extends Machine { + @Override + public void doWork() { + System.out.println("Bulldozer start working"); + } + @Override + public void stopWork() { + System.out.println("Bulldozer stop working"); + } +} diff --git a/src/main/java/core/basesyntax/Excavator.java b/src/main/java/core/basesyntax/Excavator.java new file mode 100644 index 000000000..f4ed1650a --- /dev/null +++ b/src/main/java/core/basesyntax/Excavator.java @@ -0,0 +1,12 @@ +package core.basesyntax; + +public class Excavator extends Machine { + @Override + public void doWork() { + System.out.println("Excavator start working"); + } + @Override + public void stopWork() { + System.out.println("Excavator stop working"); + } +} diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java new file mode 100644 index 000000000..a6cadef0d --- /dev/null +++ b/src/main/java/core/basesyntax/Machine.java @@ -0,0 +1,10 @@ +package core.basesyntax; + +public abstract class Machine { + public void doWork(){ + + } + public void stopWork() { + + } +} diff --git a/src/main/java/core/basesyntax/MainApp.java b/src/main/java/core/basesyntax/MainApp.java index f99e9a019..5a0869cca 100644 --- a/src/main/java/core/basesyntax/MainApp.java +++ b/src/main/java/core/basesyntax/MainApp.java @@ -1,5 +1,12 @@ package core.basesyntax; public class MainApp { + public static void main(String[] ggss) { + Machine[] machines = {new Truck(), new Excavator(), new Bulldozer()}; + for (int i = 0; i < machines.length; i++) { + machines[i].doWork(); + machines[i].stopWork(); + } + } } diff --git a/src/main/java/core/basesyntax/Truck.java b/src/main/java/core/basesyntax/Truck.java new file mode 100644 index 000000000..cecf2dc6e --- /dev/null +++ b/src/main/java/core/basesyntax/Truck.java @@ -0,0 +1,12 @@ +package core.basesyntax; + +public class Truck extends Machine { + @Override + public void doWork() { + System.out.println("Truck start working"); + } + @Override + public void stopWork() { + System.out.println("Truck stop working"); + } +} diff --git a/untitled/.idea/vcs.xml b/untitled/.idea/vcs.xml new file mode 100644 index 000000000..6c0b86358 --- /dev/null +++ b/untitled/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/untitled/.idea/workspace.xml b/untitled/.idea/workspace.xml new file mode 100644 index 000000000..ca51d8966 --- /dev/null +++ b/untitled/.idea/workspace.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1728650846150 + + + + \ No newline at end of file From 05d36224890f0b30b11569e356ef4721babbcc1d Mon Sep 17 00:00:00 2001 From: Roman Leshchyshyn Date: Fri, 11 Oct 2024 16:57:17 +0300 Subject: [PATCH 2/5] hi --- src/main/java/core/basesyntax/MainApp.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/core/basesyntax/MainApp.java b/src/main/java/core/basesyntax/MainApp.java index 5a0869cca..852f30281 100644 --- a/src/main/java/core/basesyntax/MainApp.java +++ b/src/main/java/core/basesyntax/MainApp.java @@ -2,8 +2,10 @@ public class MainApp { public static void main(String[] ggss) { + Machine[] machines = {new Truck(), new Excavator(), new Bulldozer()}; - for (int i = 0; i < machines.length; i++) { + + for(int i = 0; i < machines.length; i++) { machines[i].doWork(); machines[i].stopWork(); } From 9738bf80cdf0302a86c4548edab32550a6a8311d Mon Sep 17 00:00:00 2001 From: Roman Leshchyshyn Date: Fri, 11 Oct 2024 17:08:52 +0300 Subject: [PATCH 3/5] hihi --- src/main/java/core/basesyntax/Machine.java | 6 ++---- src/main/java/core/basesyntax/MainApp.java | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java index a6cadef0d..536d0746c 100644 --- a/src/main/java/core/basesyntax/Machine.java +++ b/src/main/java/core/basesyntax/Machine.java @@ -1,10 +1,8 @@ package core.basesyntax; public abstract class Machine { - public void doWork(){ - - } + public abstract void doWork() ; public void stopWork() { - + System.out.println("Machine stop working"); } } diff --git a/src/main/java/core/basesyntax/MainApp.java b/src/main/java/core/basesyntax/MainApp.java index 852f30281..5a0869cca 100644 --- a/src/main/java/core/basesyntax/MainApp.java +++ b/src/main/java/core/basesyntax/MainApp.java @@ -2,10 +2,8 @@ public class MainApp { public static void main(String[] ggss) { - Machine[] machines = {new Truck(), new Excavator(), new Bulldozer()}; - - for(int i = 0; i < machines.length; i++) { + for (int i = 0; i < machines.length; i++) { machines[i].doWork(); machines[i].stopWork(); } From eb9fd8e8153f1f9174ec54a3e2e2e6a285adb76a Mon Sep 17 00:00:00 2001 From: Roman Leshchyshyn Date: Fri, 11 Oct 2024 17:18:47 +0300 Subject: [PATCH 4/5] hihig --- src/main/java/core/basesyntax/Bulldozer.java | 1 + src/main/java/core/basesyntax/Excavator.java | 1 + src/main/java/core/basesyntax/Machine.java | 3 ++- src/main/java/core/basesyntax/Truck.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/core/basesyntax/Bulldozer.java b/src/main/java/core/basesyntax/Bulldozer.java index b21f8ba96..52a0b7ac0 100644 --- a/src/main/java/core/basesyntax/Bulldozer.java +++ b/src/main/java/core/basesyntax/Bulldozer.java @@ -5,6 +5,7 @@ public class Bulldozer extends Machine { public void doWork() { System.out.println("Bulldozer start working"); } + @Override public void stopWork() { System.out.println("Bulldozer stop working"); diff --git a/src/main/java/core/basesyntax/Excavator.java b/src/main/java/core/basesyntax/Excavator.java index f4ed1650a..2a1dabadf 100644 --- a/src/main/java/core/basesyntax/Excavator.java +++ b/src/main/java/core/basesyntax/Excavator.java @@ -5,6 +5,7 @@ public class Excavator extends Machine { public void doWork() { System.out.println("Excavator start working"); } + @Override public void stopWork() { System.out.println("Excavator stop working"); diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java index 536d0746c..94344d4da 100644 --- a/src/main/java/core/basesyntax/Machine.java +++ b/src/main/java/core/basesyntax/Machine.java @@ -1,7 +1,8 @@ package core.basesyntax; public abstract class Machine { - public abstract void doWork() ; + public abstract void doWork(); + public void stopWork() { System.out.println("Machine stop working"); } diff --git a/src/main/java/core/basesyntax/Truck.java b/src/main/java/core/basesyntax/Truck.java index cecf2dc6e..84d71eb92 100644 --- a/src/main/java/core/basesyntax/Truck.java +++ b/src/main/java/core/basesyntax/Truck.java @@ -5,6 +5,7 @@ public class Truck extends Machine { public void doWork() { System.out.println("Truck start working"); } + @Override public void stopWork() { System.out.println("Truck stop working"); From c2586d42e13579eacf2b12daf8c7504921076913 Mon Sep 17 00:00:00 2001 From: Roman Leshchyshyn Date: Fri, 11 Oct 2024 17:20:36 +0300 Subject: [PATCH 5/5] hihigigi --- src/main/java/core/basesyntax/Machine.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java index 94344d4da..cad5be453 100644 --- a/src/main/java/core/basesyntax/Machine.java +++ b/src/main/java/core/basesyntax/Machine.java @@ -3,7 +3,5 @@ public abstract class Machine { public abstract void doWork(); - public void stopWork() { - System.out.println("Machine stop working"); - } + public abstract void stopWork(); }