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
14 changes: 14 additions & 0 deletions src/main/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package core.basesyntax;

public class Bulldozer extends Machine {

Choose a reason for hiding this comment

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

This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature.' This empty line should be removed.

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

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

public class Excavator extends Machine {

Choose a reason for hiding this comment

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

This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature.' This empty line after the class declaration should be removed.

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

Choose a reason for hiding this comment

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

This violates checklist item #1: 'Please don't add redundant empty lines to your code.' According to the provided checklist, empty lines between methods should be avoided.

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

public abstract class Machine {

public abstract void doWork();

public abstract void stopWork();
}
12 changes: 12 additions & 0 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@

public class MainApp {

public static void main(String[] args) {

Choose a reason for hiding this comment

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

This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature.' The blank line before this method declaration is unnecessary and should be removed.

Machine[] machines = new Machine[]{
new Truck(),
new Excavator(),
new Bulldozer()
};

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

public class Truck extends Machine {

Choose a reason for hiding this comment

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

This violates checklist item #1: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." This empty line after the class declaration should be removed to improve code style.

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

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