-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement Machine, Truck, Bulldozer, and Excavator classes #2171
base: master
Are you sure you want to change the base?
Implement Machine, Truck, Bulldozer, and Excavator classes #2171
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.
Great job on implementing the Machine class hierarchy and MainApp class! 👍 The use of abstraction and polymorphism is spot on, and the code meets the core functionality requirements. Just remember for next time to make your log messages more specific to the machine in action – it will make debugging and maintenance a lot easier. Keep up the good work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
public class Bulldozer extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Bulldozer started working."); |
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 message should indicate what type of Machine
is working right now. Consider specifying that it is a Bulldozer
to make the message more informative.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Bulldozer stopped working."); |
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.
Similarly, the stop message should be more informative and indicate that it is a Bulldozer
that has stopped working.
public class Excavator extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Excavator started working."); |
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 message should be more informative and indicate that it is an Excavator that is working. Consider rephrasing it to 'Excavator is working.' to clearly reflect the type of Machine.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Excavator stopped working."); |
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.
Similarly, the stop message should also be informative. It could be rephrased to 'Excavator has stopped working.' to maintain consistency and clarity.
public class Truck extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Truck started working."); |
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 message 'Truck started working.' should be more informative. For instance, it could include the type of machine that has started working. Consider revising it to something like 'Truck is now working.' to clearly indicate the type of machine.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Truck stopped working."); |
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.
Similarly, the message 'Truck stopped working.' should be more informative. You might want to change it to 'Truck has stopped working.' to make it clear which machine has stopped working.
No description provided.