Skip to content

Commit

Permalink
third try
Browse files Browse the repository at this point in the history
  • Loading branch information
Ann1120-ua committed Nov 14, 2024
1 parent ea5b4fb commit ad76482
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src/test/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}


4 changes: 2 additions & 2 deletions src/test/java/core/basesyntax/Excavator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

2 changes: 1 addition & 1 deletion src/test/java/core/basesyntax/Machine.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

abstract class Machine {
public abstract class Machine {
public abstract void doWork();
public abstract void stopWork();
}
7 changes: 4 additions & 3 deletions src/test/java/core/basesyntax/MainAppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -12,6 +13,6 @@ public static void main(String[] args) {
machine.doWork();
machine.stopWork();
}
}
}
}

}
4 changes: 2 additions & 2 deletions src/test/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

0 comments on commit ad76482

Please sign in to comment.