-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Task completion #2402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Task completion #2402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Great work! The core requirements are fully met: your Machine
hierarchy is correct, each subclass provides clear doWork()
and stopWork()
implementations, and MainApp
properly demonstrates polymorphism by iterating over a Machine[]
and invoking both methods.
Minor improvement (non-blocking):
- In
src/main/java/core/basesyntax/Excavator.java
andsrc/main/java/core/basesyntax/Truck.java
, add@Override
above thedoWork()
method. This helps the compiler catch signature mismatches and keeps the intent explicit.- Example:
- Line where
public void doWork()
is declared: add@Override
directly above it.
- Line where
- Example:
Everything else looks clean and consistent. Nice job on clear messages and adherence to method signatures. Keep it up!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
package core.basesyntax; | ||
|
||
public class Excavator extends Machine { | ||
public void doWork() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @Override
annotation is missing above the doWork()
method. While not strictly required for functionality, it is a best practice and helps ensure correct overriding. Consider adding @Override
above the doWork()
method for consistency and clarity.
package core.basesyntax; | ||
|
||
public class Truck extends Machine { | ||
public void doWork() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @Override
annotation is missing above the doWork()
method. While not strictly required for functionality, it is a best practice and helps ensure correct overriding. Consider adding @Override
above the doWork()
method for consistency and clarity.
No description provided.