-
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
Created class Machine #2156
Created class Machine #2156
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 Excavator class and MainApp.java according to the checklist! 🎉 While the messages in the methods could be more informative, this is a minor issue and doesn't significantly impact the functionality of your code. Keep up the good work, and consider enhancing the messages for better clarity in future updates! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
public class Bulldozer extends Machine { | ||
|
||
public void doWork() { | ||
System.out.println("Bulldozer 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 should indicate what type of Machine
is working right now. Consider including the class name in the message for clarity, e.g., 'Bulldozer is working.'
} | ||
|
||
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. Include the class name to clarify which machine stopped, e.g., 'Bulldozer has stopped working.'
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 'doWork' method should be more informative. It should indicate that it is an Excavator that has started working. Consider including the type of machine in the message.
} | ||
|
||
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.
Similar to the 'doWork' method, the message in 'stopWork' should also be more informative. Make sure it indicates that it is an Excavator that has stopped working.
@@ -0,0 +1,8 @@ | |||
package core.basesyntax; | |||
|
|||
abstract class 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.
According to the checklist, class elements should have appropriate access modifiers. Consider if the abstract class Machine
should be public to be accessible by other classes in different packages.
@@ -0,0 +1,13 @@ | |||
package core.basesyntax; | |||
|
|||
class Truck 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.
The class Truck
should be declared as public to match the visibility of its superclass Machine
and to be accessible from other packages.
class Truck extends Machine { | ||
@Override | ||
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 doWork
method is not informative enough. It should indicate that the 'Truck' is the type of Machine
that is working now. For example: "Truck is doing its work."
System.out.println("Truck started its work."); | ||
} | ||
|
||
public void 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.
The stopWork
method should be annotated with @Override
to clearly indicate that it is overriding a method from the superclass Machine
.
} | ||
|
||
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 stopWork
method is not informative enough. It should indicate that the 'Truck' is the type of Machine
that has stopped working. For example: "Truck has stopped its work."
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.
package core.basesyntax; | ||
|
||
public class Excavator 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.
same
package core.basesyntax; | ||
|
||
abstract class 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.
same
@@ -0,0 +1,6 @@ | |||
package core.basesyntax; | |||
|
|||
abstract class 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.
abstract class Machine { | |
public abstract class Machine { |
@@ -0,0 +1,13 @@ | |||
package core.basesyntax; | |||
|
|||
class Truck 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.
class Truck extends Machine { | |
public class Truck extends Machine { |
No description provided.