Skip to content

Commit

Permalink
Fixed syntax and text in subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
sannchous committed Oct 8, 2024
1 parent 55b8c9f commit 2155395
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public class Bulldozer extends Machine {

@Override
public void doWork() {
System.out.println("Bulldozer started working!");
System.out.println("Bulldozer is starting its work!");
}

@Override
public void stopWork() {
System.out.println("Bulldozer stopped working ;( ");
System.out.println("Bulldozer has stopped working ;( ");
}
}
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/Excavator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
public class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator started working!");
System.out.println("Excavator is starting its work!");
}

@Override
public void stopWork() {
System.out.println("Excavator stopped working ;( ");
System.out.println("Excavator has stopped working ;( ");
}
}
3 changes: 0 additions & 3 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package core.basesyntax;

public class MainApp {

public static void main(String[] args) {
Machine truck = new Truck();
Machine bulldozer = new Bulldozer();
Machine excavator = new Excavator();

Machine[] machines = {truck, bulldozer, excavator};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public class Truck extends Machine {

@Override
public void doWork() {
System.out.println("Truck started working!");
System.out.println("Truck is starting its work!");
}

@Override
public void stopWork() {
System.out.println("Truck stopped working ;( ");
System.out.println("Truck has stopped working ;( ");
}
}

0 comments on commit 2155395

Please sign in to comment.