From 334a54961b07c1a9a05dbea8bf61296616c3c790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20G=C4=85ga=C5=82o?= Date: Sun, 15 Oct 2023 12:01:19 +0200 Subject: [PATCH] Fixed checkstyle errors v1 --- src/main/java/core/basesyntax/Machine.java | 1 + src/main/java/core/basesyntax/Machines.java | 55 +++++++++++---------- src/main/java/core/basesyntax/MainApp.java | 6 +-- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/main/java/core/basesyntax/Machine.java b/src/main/java/core/basesyntax/Machine.java index 7900ea90e..8f60ccf51 100644 --- a/src/main/java/core/basesyntax/Machine.java +++ b/src/main/java/core/basesyntax/Machine.java @@ -2,6 +2,7 @@ public abstract class Machine { public abstract void doWork(); + public abstract void stopWork(); } diff --git a/src/main/java/core/basesyntax/Machines.java b/src/main/java/core/basesyntax/Machines.java index 13ef6ec07..46ed85649 100644 --- a/src/main/java/core/basesyntax/Machines.java +++ b/src/main/java/core/basesyntax/Machines.java @@ -1,40 +1,41 @@ package core.basesyntax; public abstract class Machines { - public static class Truck extends Machine { - @Override - public void doWork() { - System.out.println("Truck started its work"); - } - @Override - public void stopWork() { - System.out.println("Truck stopped working"); + public static class Truck extends Machine { + @Override + public void doWork() { + System.out.println("Truck started its work"); } - } - public static class Bulldozer extends Machine { - @Override - public void doWork() { - System.out.println("Bulldozer started its work"); + @Override + public void stopWork() { + System.out.println("Truck stopped working"); + } } - @Override - public void stopWork() { - System.out.println("Bulldozer stopped working"); - } - } - public static class Excavator extends Machine { - @Override - public void doWork() { - System.out.println("Excavator started its work"); - } - @Override - public void stopWork() { - System.out.println("Excavator stopped working"); + public static class Bulldozer extends Machine { + @Override + public void doWork() { + System.out.println("Bulldozer started its work"); + } + + @Override + public void stopWork() { + System.out.println("Bulldozer stopped working"); + } } - } + public static class Excavator extends Machine { + @Override + public void doWork() { + System.out.println("Excavator started its work"); + } + @Override + public void stopWork() { + System.out.println("Excavator stopped working"); + } + } } diff --git a/src/main/java/core/basesyntax/MainApp.java b/src/main/java/core/basesyntax/MainApp.java index 980b23272..e594306a2 100644 --- a/src/main/java/core/basesyntax/MainApp.java +++ b/src/main/java/core/basesyntax/MainApp.java @@ -1,18 +1,18 @@ package core.basesyntax; public class MainApp { - public static void main (String[] args) { + public static void main(String[] args) { Machine[] machines = { new Machines.Truck(), new Machines.Bulldozer(), new Machines.Excavator() }; - for(Machine machine : machines) { + for (Machine machine : machines) { machine.doWork(); } - for(Machine machine : machines) { + for (Machine machine : machines) { machine.stopWork(); } }