Skip to content
Open

V1 #2470

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
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<properties>
<jdk.version>17</jdk.version>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.checkstyle.plugin.version>3.1.1</maven.checkstyle.plugin.version>
Expand Down Expand Up @@ -53,7 +54,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
Expand Down
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 {

Copy link

Choose a reason for hiding this comment

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

Remove this redundant empty line.

@Override
public void doWork() {
System.out.println("Bulldozer starts.....");
Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

}

@Override
public void stopWork() {
System.out.println("Bulldozer stops.....");
Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

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

public class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavatore starts...");
Copy link

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Excavatore starts...");
System.out.println("Excavator starts...");

Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

}

@Override
public void stopWork() {
System.out.println("Excavatore stops...");
Copy link

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Excavatore stops...");
System.out.println("Excavator stops...");

Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

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

public abstract class Machine {
public abstract void doWork();

public abstract void stopWork();
}
8 changes: 7 additions & 1 deletion src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package core.basesyntax;

public class MainApp {

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

Choose a reason for hiding this comment

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

Conventional style is:

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

for (Machine machine: machines) {
Copy link

Choose a reason for hiding this comment

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

Enhanced for-loop spacing:

Suggested change
for (Machine machine: machines) {
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 {

Copy link

Choose a reason for hiding this comment

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

Remove this redundant empty line.

@Override
public void doWork() {
System.out.println("Track starts wrrrr....");
Copy link

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Track starts wrrrr....");
System.out.println("Truck starts wrrrr....");

Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

}

@Override
public void stopWork() {
System.out.println("Track stops....");
Copy link

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Track stops....");
System.out.println("Truck stops....");

Copy link

Choose a reason for hiding this comment

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

Messages like "....."/"wrrrr" are noisy; the checklist asks for informative messages.

}
}