-
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
Creating machines arrays and loop #2159
base: master
Are you sure you want to change the base?
Creating machines arrays and loop #2159
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 defining the abstract class Machine
and using polymorphism in MainApp.java
! Just a small note for the future: try to keep your code tidy by removing unnecessary empty lines. It's a minor detail but helps in maintaining a clean and professional codebase. Keep up the good work! 👍💻
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -0,0 +1,15 @@ | |||
package core.basesyntax; | |||
|
|||
public class Bulldozer extends Machine{ |
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.
There should not be an empty line after the class declaration. Please remove the redundant empty line to comply with the coding standards.
public class Bulldozer extends Machine{ | ||
@Override | ||
public void doWork() { | ||
System.out.println("Bulldozer machine started its work."); |
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 in 'System.out.println' should be more informative and indicate the type of machine. Consider specifying that it is a Bulldozer that has started working.
@Override | ||
public void stopWork() { | ||
|
||
System.out.println("Bulldozer machines 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.
The message in 'System.out.println' should be more informative and indicate the type of machine. Consider specifying that it is a Bulldozer that has stopped working. Also, there's a typo in the word 'machines', it should be singular 'machine'.
public class Excavator extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Excavator machine started its work."); |
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 in the 'doWork' method should be more informative and indicate that the 'Excavator' is working. For example, 'Excavator is starting its work.'
@Override | ||
public void stopWork() { | ||
|
||
System.out.println("Excavator machines 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.
The message in the 'stopWork' method should be more informative and indicate that the 'Excavator' has stopped working. Also, there is a typographical error, it should be 'Excavator machine' instead of 'Excavator machines'. For example, 'Excavator has stopped its work.'
|
||
machine.doWork(); | ||
machine.stopWork(); | ||
|
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.
Remove the redundant empty line after the loop block to follow the checklist's best practices.
machine.stopWork(); | ||
|
||
} | ||
|
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.
Please remove the redundant empty line before the closing brace of the method.
} | ||
|
||
} | ||
|
||
} |
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.
Remove the redundant empty line before the closing brace of the class.
@Override | ||
public void doWork() { | ||
|
||
System.out.println("Truck machine started its work."); |
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 in the doWork
method should be more informative and indicate that it is a Truck
that is working. Consider specifying that explicitly, for example: 'Truck is starting its work.'
@Override | ||
public void stopWork() { | ||
|
||
System.out.println("Truck machines 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 in the stopWork
method should be more informative. It should indicate that it is a Truck
that has stopped working. For instance: 'Truck has stopped working.'
No description provided.