Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
<linkXRef>false</linkXRef>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>25</source>
<target>25</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
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 {

Choose a reason for hiding this comment

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

This empty line is redundant. This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration...'.

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

@Override
public void stopWork() {
System.out.println("Bulldozer stopped work");
}
}
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 {

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

@Override
public void stopWork() {
System.out.println("Excavator stopped work");
}
}
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 {

Choose a reason for hiding this comment

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

This empty line after the class declaration is redundant. This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration...'

Choose a reason for hiding this comment

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

This redundant empty line was mentioned in the previous review. Please remove it to adhere to the coding style guidelines. 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.'

public abstract void doWork();

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

public class MainApp {
public static void main(String[] args) {
Machine[] machines = new Machine[7];

machines[0] = new Truck();
machines[1] = new Bulldozer();
machines[2] = new Excavator();
machines[3] = new Excavator();
machines[4] = new Truck();
machines[5] = new Bulldozer();
machines[6] = new Truck();

for (int i = 0; i < machines.length; i++) {
machines[i].doWork();
machines[i].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 empty line after the class declaration is redundant. This violates checklist item #1: 'Please don't add redundant empty lines to your code. We don't need them after class declaration...'

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

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