Conversation
methods in MainApp class
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on this task! I am approving your solution as it correctly implements all the requirements for inheritance and polymorphism. The class structure is well-designed, and the MainApp correctly demonstrates how to work with different machine types through an abstract reference.
For future improvements, pay attention to code cleanliness. I noticed an unused import in src/main/java/core/basesyntax/Machine.java that can be removed. Also, try to avoid extra blank lines at the end of files to keep your code neat.
Overall, this is a solid implementation. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| @@ -0,0 +1,11 @@ | |||
| package core.basesyntax; | |||
|
|
|||
| import jdk.dynalink.linker.GuardedInvocationTransformer; | |||
There was a problem hiding this comment.
This import is not used within the file and can be removed. Keeping your code free of unused imports makes it cleaner and easier to read.
Create the Machine class with doWork() and stopWork() methods.
Add child classes Truck, Bulldozer, and Excavator, each overriding doWork() and stopWork().
In MainApp, initialize an array of these objects and loop through them to call their methods.