Feature/machine - #2634
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully fulfills all core functional requirements for this OOP task. The abstract Machine class is properly defined with doWork() and stopWork() abstract methods, all three subclasses (Truck, Bulldozer, Excavator) correctly extend it with informative English messages, and MainApp uses polymorphism via a Machine[] array while calling both methods in a loop. The only issues identified are related to redundant empty lines in Machine.java, MainApp.java, and Truck.java - these are style/whitespace concerns that don't affect functionality. According to the decision criteria, whitespace and empty line issues are considered non-blockers since they're cosmetic style matters rather than critical functional problems. Your solution is approved. The linter will catch the whitespace issues, and fixing them will be a straightforward cleanup task. Great work on the inheritance hierarchy and polymorphism implementation!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| package core.basesyntax; | ||
|
|
||
| public abstract class Machine { | ||
|
|
There was a problem hiding this comment.
Redundant empty lines after class declaration and between methods - this follows the 'Bad example' pattern from the checklist. Consider removing these empty lines to match the expected style.
| public abstract void doWork(); | ||
|
|
||
| public abstract void stopWork(); | ||
| } |
There was a problem hiding this comment.
Redundant empty line after method signature - this follows the 'Bad example' pattern from the checklist.
| @@ -2,4 +2,19 @@ | |||
|
|
|||
| public class MainApp { | |||
|
|
|||
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after class declaration. Remove this empty line (line 4).
| @@ -2,4 +2,19 @@ | |||
|
|
|||
| public class MainApp { | |||
|
|
|||
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after class declaration. Remove this empty line (line 4).
| @@ -2,4 +2,19 @@ | |||
|
|
|||
| public class MainApp { | |||
|
|
|||
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after class declaration. Remove this empty line (line 4).
| new Bulldozer(), | ||
| new Excavator() | ||
| }; | ||
|
|
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after array declaration. Remove this empty line (line 12).
| for (Machine machine : machines) { | ||
| machine.doWork(); | ||
| machine.stopWork(); | ||
|
|
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line inside loop. Remove this empty line (line 16).
| package core.basesyntax; | ||
|
|
||
| public class Truck extends Machine { | ||
|
|
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after class declaration. Remove this empty line.
| @Override | ||
| public void doWork() { | ||
| System.out.println("Truck started its work"); | ||
| } |
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line after method declaration. Remove this empty line.
| public void doWork() { | ||
| System.out.println("Truck started its work"); | ||
| } | ||
|
|
There was a problem hiding this comment.
This violates checklist item #0: redundant empty line between methods. Remove this empty line.
No description provided.