Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package core.basesyntax;

public class Bulldozer extends Machine {

public void doWork() {
System.out.println("Bulldozer started working");
}

public void stopWork() {
System.out.println("Bulldozer stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Bulldozer stoped working" should be "Bulldozer stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

}
}
12 changes: 12 additions & 0 deletions src/main/java/core/basesyntax/Excavator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package core.basesyntax;

public class Excavator extends Machine {

public void doWork() {
System.out.println("Excavator started working");
}

public void stopWork() {
System.out.println("Excavator stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Excavator stoped working" should be "Excavator stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

}
}
9 changes: 9 additions & 0 deletions src/main/java/core/basesyntax/Machine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package core.basesyntax;

public abstract class Machine {

public abstract void doWork();

public abstract void stopWork();

}
13 changes: 12 additions & 1 deletion src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package core.basesyntax;

public class MainApp {


public static void main(String[] args) {
Machine[] machines = new Machine[] {
new Truck(),
new Bulldozer(),
new Excavator()
};
for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}
}
}
12 changes: 12 additions & 0 deletions src/main/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package core.basesyntax;

public class Truck extends Machine {

public void doWork() {
System.out.println("Truck started working");
}

public void stopWork() {
System.out.println("Truck stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Truck stoped working" should be "Truck stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

}
}