Skip to content

Conversation

MishaLehotskyi
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Overall, your solution meets the core functional requirements: Machine is abstract with the correct method signatures, each concrete class (Truck, Bulldozer, Excavator) properly overrides doWork() and stopWork(), and MainApp demonstrates polymorphism by iterating over a Machine[] and invoking both methods. The code will compile and run correctly.

Minor style issues remain: redundant empty lines in multiple files, which the checklist asks to avoid. Please remove the extra blank lines at the noted spots:

  • MainApp.java: remove the redundant empty line in the import/definition area.
  • Bulldozer.java: line 2 (after package) and around line 8 (between methods).
  • Excavator.java: line 2 (after package) and around line 8 (between doWork() and the next @Override). Also ensure a space before { in extends Machine {.
  • Machine.java: remove the blank line before the class body and the blank line between doWork() and stopWork().
  • Truck.java: remove the redundant blank line after the package and the extra blank line between methods.

Optional: Keep message phrasing consistent across classes (e.g., all “started working”/“stopped working”). Nice work demonstrating polymorphism—just tidy up the formatting to fully align with the checklist.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

import core.basesyntax.models.Excavator;
import core.basesyntax.models.Machine;
import core.basesyntax.models.Truck;

Choose a reason for hiding this comment

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

There is a redundant empty line here. This violates the checklist item: "Please don't add redundant empty lines to your code." Consider removing this blank line to keep the file formatting consistent with the project's style guide .

@@ -0,0 +1,13 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This violates checklist item "Please don't add redundant empty lines to your code." Consider removing the blank line here; there is no need for an empty line after the package declaration.

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

Choose a reason for hiding this comment

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

This violates checklist item "Please don't add redundant empty lines to your code." Consider removing this blank line between method implementations to keep the file concise and consistent with the project's style guidance.

@@ -0,0 +1,13 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This violates checklist item: "Please don't add redundant empty lines to your code." The blank line at line 2 (between the package declaration and the class declaration) is unnecessary — please remove it to match the requested style guidance (checklist) .

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

Choose a reason for hiding this comment

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

This violates checklist item: "Please don't add redundant empty lines to your code." The blank line at line 8 (between the end of doWork() and the next @Override) is redundant — please remove it to keep the code compact and consistent with the checklist guidance (checklist) .

@@ -0,0 +1,7 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This file contains a redundant empty line before the class declaration. This violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Consider removing this blank line so the package and class declaration are adjacent (no extra empty line) .


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

Choose a reason for hiding this comment

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

There is an unnecessary blank line between the doWork() and stopWork() method signatures. This violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the empty line so the two abstract methods appear consecutively without extra spacing .

@@ -0,0 +1,13 @@
package core.basesyntax.models;

Choose a reason for hiding this comment

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

This file contains a redundant empty line. This violates the checklist item: "Please don't add redundant empty lines to your code." Consider removing this blank line to keep the file tidy and consistent with the project's style guide.

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

Choose a reason for hiding this comment

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

This blank line between methods is redundant. This violates the checklist item: "Please don't add redundant empty lines to your code." Remove the empty line between the end of doWork() and the @Override for stopWork() to follow the style guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants