Skip to content

Conversation

@WOLFnik5
Copy link

@WOLFnik5 WOLFnik5 commented Oct 2, 2025

Create abstract Machine class with doWork() and stopWork() methods
Add Truck, Bulldozer and Excavator classes extending Machine
Implement MainApp with array of machines and looped work calls

Add Truck, Bulldozer and Excavator classes extending Machine
Implement MainApp with array of machines and looped work calls
Add Truck, Bulldozer and Excavator classes extending Machine
Implement MainApp with array of machines and looped work calls
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

Your solution meets the functional requirements: the abstract Machine defines doWork() and stopWork(), each concrete class (Truck, Bulldozer, Excavator) overrides them with English messages, and MainApp iterates over a Machine[] calling both methods. Well done on using polymorphism correctly and keeping method signatures public.

Minor style notes to address next time (non-blocking):

  • [CHECKLIST] Remove redundant empty lines:
    • Machine.java: delete the blank line between the two abstract method declarations.
    • MainApp.java line 6: remove the extra blank line inside main.
    • Truck.java: remove the blank line between doWork() and the @Override of stopWork().
  • Optional: keep spacing consistent in array literals (e.g., add a space after commas).

Overall, nice work—functionality is correct and clear. Keep polishing formatting to align fully 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


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.

This violates 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 blank line between the two abstract method declarations so there is no empty line after the doWork() signature. See the checklist guidance for this rule.

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

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. We don't need them after class declaration or method signature." Remove the blank line at line 6 to avoid redundant empty lines and match the style guidance.

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

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. We don't need them after class declaration or method signature." Remove the blank line between the doWork() method and the @Override for stopWork() so there are no redundant empty lines in the class.

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