-
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
solved task #2173
base: master
Are you sure you want to change the base?
solved task #2173
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.
Hey there! It looks like you've made some good progress with your code, but there are a few important tweaks we need to address to make it just right. 🛠️ The messages for starting and stopping work in your Machine
implementations need to be a bit more descriptive. It's important that they clearly communicate what type of machine is in action and what it's doing. Also, let's tidy up any unused variables to keep your code looking sharp and clean. With these changes, your code will be in top shape! Keep up the good work, and I'm looking forward to seeing your next iteration. 👍
✨ 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 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 should indicate what type of Machine
is working right now Truck
, Bulldozer
or Excavator
. Consider rephrasing to include the type of the machine, for example: 'Bulldozer is doing its work.'
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Bulldozer stopped 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.
Similar to the doWork
method, the message in stopWork
should also be more informative and indicate the type of machine. For instance: 'Bulldozer has stopped working.'
public class Excavator extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Excavator started 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 'Excavator started work' could be more informative. According to the checklist, the message should indicate what type of Machine
is working right now. Consider providing more details about the work the Excavator is doing.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Excavator stopped 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.
Similarly, the message 'Excavator stopped work' could be more informative. It should describe the state of the Excavator when it stops working, perhaps indicating that it is shutting down or that it has completed its tasks.
@@ -1,5 +1,16 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainApp { | |||
|
|||
public static void main(String[] args) { | |||
String[] mashine = new String[] {"Truck", "Bulldozer", "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.
The variable name mashine
contains a typo and is not used in the code. If it's not needed, it should be removed to keep the code clean.
Machine truck = new Truck(); | ||
Machine bulldozer = new Bulldozer(); | ||
Machine excavator = 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.
Good job using abstract references for Machine
types. This allows for polymorphism in the code.
truck.doWork(); | ||
bulldozer.doWork(); | ||
excavator.doWork(); | ||
truck.stopWork(); | ||
bulldozer.stopWork(); | ||
excavator.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.
Make sure that the messages in the doWork()
and stopWork()
methods are informative and indicate what type of Machine
is working or stopping work.
public class Truck extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Truck started 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 'Truck started work' could be more informative. It should indicate what type of Machine is working. Consider including the specific action the Truck is performing.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Truck stopped 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.
Similarly, the message 'Truck stopped work' should be more informative and reflect the specific action the Truck has ceased performing.
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 Excavator class and ensuring that it adheres to the Machine abstract class methods! 🎉 Remember to make the messages in the doWork
and stopWork
methods more informative to provide clarity on what each machine is doing. 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 is doing 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 should be more informative and indicate the type of Machine
that is working. Consider specifying that a Bulldozer
is operating.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Bulldozer has 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 to the doWork
method, the message in stopWork
should be more informative. Specify that a Bulldozer
has stopped working.
public class Excavator extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Excavator is doing 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 should be more informative and indicate that it is an Excavator
that is working. For example: 'Excavator started its engine and is digging.'
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Excavator has 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 stop message should also be more informative. Consider something like: 'Excavator has been turned off and can no longer dig.'
@@ -1,5 +1,16 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainApp { | |||
|
|||
public static void main(String[] args) { | |||
String[] mashine = new String[] {"Truck", "Bulldozer", "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.
The array mashine
is declared but never used in the code. If this array is not needed, it should be removed to keep the code clean and avoid unnecessary declarations.
public class Truck extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Truck is doing 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 'Truck is doing its work.' is not very informative. It would be better to specify what kind of work the Truck is doing, to make the message more informative as per the checklist.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Truck has 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 has stopped working.' could be more descriptive. Consider specifying what indicates that the Truck has stopped its work.
No description provided.