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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after class declaration. Remove the empty line on line 2.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after class declaration. Remove the empty line on line 2.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after class declaration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after class declaration.

public class Bulldozer extends Machine {
public void doWork() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after method signature.

System.out.println("Bulldozer started its work");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after method closing brace.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after method closing brace.


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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line.

public class Excavator extends Machine {
public void doWork() {
System.out.println("Excavator started its work");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after method signature. Remove this empty line.

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after method signature. Remove this empty line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after method signature. Remove this empty line.


public void stopWork() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line.

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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires creating a Machine array containing all three machine instances. Currently, separate variables are created instead of an array.

Comment on lines +4 to +5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line after method signature - this follows the 'Bad example' pattern from the checklist.

public abstract void stopWork();
}
Comment on lines +6 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line after method declaration - this follows the 'Bad example' pattern from the checklist.

Comment on lines +6 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line after method declaration - this follows the 'Bad example' pattern from the checklist.


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

public class MainApp {
public static void main(String[] args) {
Machine truc = new Truck();
truc.doWork();
truc.stopWork();

Machine bulldozer = new Bulldozer();
bulldozer.doWork();
bulldozer.stopWork();

Machine excavator = new Excavator();
excavator.doWork();
excavator.stopWork();
Comment on lines +4 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The description requires creating a 'Machine array' and calling methods 'in a loop'. Currently, three separate variables are used instead of an array, and there is no loop. This doesn't demonstrate polymorphism as intended.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after class declaration. Remove this empty line as per the 'Bad example' pattern in the checklist.

public class Truck extends Machine {
public void doWork() {
System.out.println("Truck started its work");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist violation: redundant empty line after method declaration. Remove this empty line as per the checklist guidelines.


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