-
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
add first commit #2180
add first commit #2180
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.
The Pull Request needs some adjustments to improve the clarity and informativeness of the messages in the doWork
and stopWork
methods. Additionally, consider enhancing code readability by using more descriptive variable names and removing redundant empty lines. Keep up the great work, and these changes will make your code even better! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -0,0 +1,11 @@ | |||
package core.basesyntax; | |||
|
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 after the package declaration.
} | ||
|
||
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.
The message should indicate what type of Machine is working right now. Consider making the message more informative by specifying the type of Machine, such as 'Excavator stopped working'.
machines[1] = new Bulldozer(); | ||
machines[2] = new Excavator(); | ||
|
||
for (Machine i : machines) { |
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.
Consider using a more descriptive variable name instead of 'i' for the loop variable, such as 'machine', to improve code readability.
} | ||
|
||
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.
The message in the stopWork
method should be more informative. According to the checklist, it should indicate the type of Machine
that is working right now, such as Truck
, Bulldozer
, or Excavator
.
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 Machine
class and its methods! While there are some suggestions for improvement, such as enhancing the messages in your methods and using abstract references for better polymorphism, these are minor and don't affect the core functionality. Keep up the good work and consider these tips for future enhancements! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -0,0 +1,11 @@ | |||
package core.basesyntax; | |||
|
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.
Redundant empty line after the package declaration. Please remove it to adhere to the checklist.
|
||
public class Excavator extends Machine { | ||
public void doWork() { | ||
System.out.println("Excavator 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 by indicating the type of Machine
that is working, such as 'Excavator'.
} | ||
|
||
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.
The message in the stopWork
method should be more informative by indicating the type of Machine
that has stopped working, such as 'Excavator'.
machines[0] = new Truck(); | ||
machines[1] = new Bulldozer(); | ||
machines[2] = new Excavator(); |
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.
Consider using abstract references instead of specific ones where possible. This will allow for better polymorphism in your code. For example, use 'Machine truck = new Truck();' instead of 'Truck truck = new Truck();'.
|
||
public class Truck extends Machine { | ||
public void doWork() { | ||
System.out.println("Truck 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 is informative, but make sure it clearly indicates the type of Machine
as required by the checklist.
} | ||
|
||
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.
The message in the stopWork
method is informative, but ensure it clearly indicates the type of Machine
as required by the checklist.
No description provided.