Skip to content

Commit

Permalink
OOP
Browse files Browse the repository at this point in the history
Fixed
  • Loading branch information
VKhmil committed Jul 24, 2023
1 parent c45e780 commit e622bee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/main/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package core.basesyntax;

public class Bulldozer extends Machine{
public class Bulldozer extends Machine {
@Override
public void doWork() {
System.out.println("Bulldozer started it's work.");

}

@Override
public void stopWork() {

System.out.println("Bulldozer stopped it's work.");
}
}
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 its work.");
}

@Override
public void stopWork() {

System.out.println("Excavator stopped its work.");
}
}
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

public class MainApp {
public static void main(String[] args) {
Machine[] machines = {new Truck(), new Bulldozer(), new Excavator()};
Machine [] machines = {new Truck(), new Bulldozer(), new Excavator()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}
}
}
}
5 changes: 2 additions & 3 deletions src/main/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package core.basesyntax;

public class Truck extends Machine {

@Override
public void doWork() {

System.out.println("Truck started it's work.");
}

@Override
public void stopWork() {

System.out.println("Truck stopped it's work.");
}
}

0 comments on commit e622bee

Please sign in to comment.