Skip to content

Commit

Permalink
Third Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 3, 2024
1 parent 39c0ea2 commit 0f79a6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 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,12 +4,12 @@ public class Bulldozer extends Machine {

@Override
public void doWork() {
System.out.println("Bulldozer start working!");
System.out.println("The bulldozer has started working");
}

@Override
public void stopWork() {
System.out.println("Bulldozer stop working!");
System.out.println("Bulldozer has stopped working!");

}

Expand Down
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 @@ -4,11 +4,11 @@ public class Excavator extends Machine {

@Override
public void doWork() {
System.out.println("Excavator start working!");
System.out.println("Excavator has started working!");
}

@Override
public void stopWork() {
System.out.println("Excavator stop working!");
System.out.println("Excavator has finished digging!");
}
}
7 changes: 0 additions & 7 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ public class MainApp {
public static void main(String[] args) {
Machine truck;
truck = new Truck();

Machine bulldozer = new Bulldozer();

Machine excavator = new Excavator();
//tablica z obiektami

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

// stworzyc petle for ktora wyswietli do i stop work

for (int i = 0; i < carPark.length; i++) {
carPark[i].doWork();
carPark[i].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,13 +4,13 @@ public class Truck extends Machine {

@Override
public void doWork() {
System.out.println("Truck start working!");
System.out.println("Truck has started working!");

}

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

}
}

0 comments on commit 0f79a6a

Please sign in to comment.