Skip to content
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

added a truck an excavator and a bulldozer as well as the beginning a… #2131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VovaPryt
Copy link

…nd end of work

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on addressing the core functionality of the code! 🌟 Just remember to make your log messages more descriptive in the future to enhance the clarity of your program's output. This will help others understand exactly which machine is operating at a glance. Keep up the good work! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate what type of Machine is working right now. Consider including the class name in the message for clarity, e.g., Bulldozer is working.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 and indicate the specific Machine type that stopped working, e.g., Bulldozer has stopped working.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 dynamically, e.g., Excavator.class.getSimpleName().


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 the specific machine type that has stopped working.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' is not very informative. Consider specifying that it is a Truck that is working, to make use of the informative messages as mentioned in the checklist.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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.' could be more informative by indicating that it is a Truck that has stopped working.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 MainApp class according to the checklist guidelines! 🌟 It looks like all the core functionality is in place and working as expected. Remember, for future enhancements, consider making your log messages more descriptive to provide clarity on which specific machine is operating. Keep up the good work! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should indicate the specific type of machine that is working. Consider including the class name in the output message to make it clear that it is a Bulldozer that has started its work.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 clearly indicate that it is a Bulldozer that has stopped working. Make sure the message is informative and specific to the Bulldozer.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Excavator started its work.' could be more informative. According to the checklist, it should indicate what type of Machine is working right now. Consider specifying that it is an Excavator machine.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 working.' could be more informative by specifying that the Excavator has stopped working.

@@ -0,0 +1,8 @@
package core.basesyntax;

abstract class Machine {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class Machine should be declared as public to ensure that it can be accessed from other packages if required.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' should be more informative. It could, for example, specify what kind of truck is working.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 and possibly indicate what kind of truck has stopped working.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on implementing the Machine class and the MainApp class correctly! 🎉 Your adherence to abstraction principles is commendable. Just a tip for the future: consider making your log messages more informative by including the machine type dynamically. This will make it easier to understand what's happening when the code is running. Keep up the good work! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate the type of machine more informatively. Consider including the class name dynamically using this.getClass().getSimpleName().


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 the stopWork method should also be more informative and include the class name dynamically.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 indicate what type of Machine is working right now. In this case, it should be more informative, for example, 'Excavator is working.'


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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. Consider changing it to 'Excavator has stopped working.' to provide clear information about the state of the machine.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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 indicate the specific type of Machine that is working. Consider making the message more informative, for example: 'Truck is doing its work.'


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 and indicate the specific type of Machine that has stopped working. For instance: 'Truck has stopped working.'

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 MainApp class! 🎉 It's fantastic to see that you've followed the checklist and used polymorphism effectively. Your main method is indeed clear and concise. Keep up the good work, and remember to always aim for informative logging in your methods to make debugging and maintenance easier. 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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. It's better to specify that it is a Bulldozer to make the message more informative as per the checklist.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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. Consider specifying that it is a Bulldozer that has stopped working.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 indicate the type of Machine that is working. Consider making the message more informative by specifying that it is an Excavator, for example: 'Excavator is starting its work.'


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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. You could say 'Excavator has stopped its work.' to clearly indicate which Machine has stopped working.

@@ -0,0 +1,8 @@
package core.basesyntax;

abstract class Machine {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class Machine should be public to be accessible from other packages, especially since it's an abstract class and is meant to be extended. Remember to use the appropriate access modifiers to follow the encapsulation principle.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' could be more informative. According to the checklist, the message should indicate what type of Machine is working. Consider specifying that it is a Truck that is working, for example: 'Truck is now working.'


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stopWork method message 'Truck stopped working.' can be made more informative and consistent with the doWork method. For example: 'Truck has stopped working.'

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 and MainApp class! Your use of abstraction and polymorphism is spot on. 🌟 Just a little note for future reference: try to clean up any unnecessary empty lines to keep your code neat and tidy. Keep up the good work! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 it is a Bulldozer in the message.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 has stopped working. Consider specifying it is a Bulldozer in the message.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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's an Excavator that is working. For example: 'Excavator is working.'


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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. Consider 'Excavator has stopped working.'


@Override
public void doWork() {
System.out.println("Truck started its work.");

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 a Truck that is working right now. For example, Truck is doing its work.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 more informative. Consider changing it to something like Truck has stopped working to clearly indicate the type of machine.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 and its methods! 👍 Your use of an abstract class and abstract methods sets a solid foundation for future extensions and ensures that any subclasses will adhere to a consistent interface. Just a small note for improvement: pay attention to the access modifiers and try to include more informative messages in your logging to make it clear which machine is performing the action. Keep up the good work, and remember that these little details will enhance the maintainability and readability of your code! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should indicate that it is a Bulldozer that is working. Consider specifying the type in a more informative way, for example: 'Bulldozer is working.'


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 clearly indicate the type of machine. For instance: 'Bulldozer has stopped working.'


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 indicate what type of Machine is working. Consider specifying that it is an Excavator in the message.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the message in stopWork method should be more informative and indicate that the Excavator has stopped working.

Comment on lines +4 to +13
public static void main(String[] args) {

Machine[] machines = {new Truck(), new Bulldozer(), new Excavator()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}

}

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 lines after the method signature (line 5) and before the closing brace of the method (line 12). According to the checklist, we don't need them after class declaration or method signature.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' could be more informative. According to the checklist, it should indicate what type of Machine is working. Consider including the class name in the message.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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.' could be more informative by including the class name to clearly indicate which Machine has stopped working.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on your Pull Request! Your abstract Machine class and MainApp class implementation are on the right track. Just remember to make your log messages more informative by including the type of machine in the start and stop work methods. This will make your code clearer and easier to understand. Keep up the good work! 👍🎉

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate what type of Machine is working. Consider specifying that it is a Bulldozer in a more informative way, as per the checklist item on writing informative messages in methods.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 and indicate that the Bulldozer has stopped working. Refer to the checklist about writing informative messages in methods.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Excavator started its work.' could be more informative. According to the checklist, it should indicate what type of Machine is working. Consider specifying that it is an Excavator in the message.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the stop message 'Excavator stopped working.' could be more descriptive. It's good practice to provide informative messages that clearly state what is happening in the code.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message "Truck started its work." could be more informative by specifying the type of machine that is working. Consider including the class name in the message for clarity.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the stopWork message could be improved for clarity by specifying the type of machine that stopped working, for example, "Truck has stopped working."

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on addressing the feedback and making the messages more informative! It's these little details that can make a big difference in understanding what's going on in the code. Keep up the good work, and always aim for clarity in your messages! 👍💼

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Bulldozer started its work.' could be more informative. It should indicate that it is a Bulldozer that is working right now.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the start message, 'Bulldozer stopped working.' could be more informative by indicating it is a Bulldozer that has stopped working.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 specific type of machine that is working. Consider specifying that an 'Excavator' is working.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 more informative. You should indicate that an 'Excavator' has stopped working.

Comment on lines +4 to +13
public static void main(String[] args) {

Machine[] machines = {new Truck(), new Bulldozer(), new Excavator()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant empty lines after the method signature and before the closing brace of the method. According to the checklist, we should not add unnecessary empty lines in such places.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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's a Truck that is working. For example, it could say 'Truck is doing its work.'


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 the stopWork method should be more informative. Consider rephrasing it to something like 'Truck has stopped working.' to clearly indicate that it's a Truck.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 MainApp class and adhering to polymorphism principles! Your code is clean, and you've done well in avoiding unnecessary empty lines. Keep up the good work! Remember, small tweaks to the log messages can enhance clarity and maintain consistency across your application. 🌟 Keep it up!

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate the type of Machine more informatively. Consider specifying that it is a Bulldozer that has started its work. For example: "Bulldozer started to move earth."


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 and indicate the type of Machine. For instance: "Bulldozer stopped moving earth."


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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. Instead of 'Excavator started its work.', consider a more informative message like 'Excavator is now working.', which clearly indicates the machine type.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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. Instead of 'Excavator stopped working.', consider 'Excavator has stopped working.', to maintain consistency and clarity.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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's a Truck that is working. For example: "Truck is working."


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the message for stopping work should be more informative. Consider changing it to something like: "Truck has stopped working."

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 following the principles of polymorphism! 👍 Just remember for next time to make your method messages a bit more descriptive to align with the project requirements. This will make your code even better and easier to understand. Keep up the good work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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. In this case, it should be more informative and indicate that a Bulldozer is working.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 clearly indicate that it is the Bulldozer that has stopped working.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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. Consider specifying what the Excavator is doing in more detail to provide clarity.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 what the Excavator has finished doing or what state it is now in.

Comment on lines 3 to +13
public class MainApp {
public static void main(String[] args) {

Machine[] machines = {new Truck(), new Bulldozer(), new Excavator()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}

}

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 lines after the class declaration and the method signature as per the checklist.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should indicate the specific type of Machine that is working, including the class name. Consider changing the message to something like 'Truck is working.' to make it more informative.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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. For example, 'Truck has stopped working.' would be more descriptive and in line with the task requirements.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 Bulldozer class and following the task requirements in the MainApp class! Just a small note for the future: try to keep an eye out for any extra empty lines to maintain a clean code structure. Keep up the good work! 🌟

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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's an Excavator in the message for clarity.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stop message should be more informative and indicate that it's an Excavator that has stopped working.

@@ -0,0 +1,8 @@
package core.basesyntax;

abstract class Machine {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the encapsulation principle and best practices, the class should have an access modifier. Consider using public for this abstract class to ensure it can be accessed from other packages if needed.

@@ -1,5 +1,14 @@
package core.basesyntax;

public class MainApp {
public static void main(String[] args) {

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 method signature as per the checklist.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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 the specific machine type that is working. Consider including the class name in the message, for example: 'Truck is doing its work.'


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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. Include the class name to clarify which machine stopped working, e.g., 'Truck has stopped working.'

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on adhering to the principles of OOP with your abstract Machine class and the use of polymorphism in MainApp! Just a minor note for future reference: including specific machine types in method messages enhances clarity and maintainability. Keep up the good work! 👍🎉

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate the type of machine that is working. Consider specifying that it is a Bulldozer in the message for clarity.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 clearly indicate that it is a Bulldozer that has stopped working.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 indicate what type of Machine is working. Consider specifying that it is an Excavator in the message to make it more informative.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 and indicate that it is the Excavator that has stopped working.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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 indicate the specific type of Machine that is working. Consider including the class name in the message for clarity.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 and indicate the specific type of Machine that has stopped working.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on implementing the classes and methods! 👍 The feedback provided is aimed at enhancing the informativeness of the log messages. These are minor suggestions that do not impact the functionality of your code. Keep up the good work, and consider refining your messages for clarity in future updates! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message "Bulldozer started its work." could be more informative. According to the checklist, it should indicate the type of Machine that is working. Consider specifying that it is a Bulldozer, for example: "Bulldozer is now working."


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the message "Bulldozer stopped working." could be more informative by specifying the type of Machine. For instance: "Bulldozer has stopped working."


@Override
public void doWork() {
System.out.println("Excavator started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message printed should be more informative and indicate that it is an 'Excavator' that is working. Refer to the checklist item about writing informative messages in methods.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 more informative. It should clearly indicate that the 'Excavator' has stopped working.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' is not very informative. Consider specifying what work the Truck is doing to make the message more informative, adhering to the checklist point about writing informative messages in methods.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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.' could be more descriptive. What kind of work has the Truck stopped? Please, make it more informative in line with the checklist guidelines.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 overriding the methods from the Machine class! Your use of abstraction in the Machine class is spot-on. 🌟 Just remember for next time to include more specific messages in your doWork and stopWork methods to clearly indicate which machine is operating. Keep up the good work! 👍

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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 indicate the type of machine that is working. Consider specifying that it is a Bulldozer in the message to make it more informative, as per the checklist.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

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 indicate the type of machine that has stopped working. Make sure the message clearly states that it is a Bulldozer.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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 an Excavator that is working. Consider specifying the action that the Excavator is performing.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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 clearly indicate that the Excavator has stopped working and, if possible, provide details of the state after stopping.

Comment on lines 3 to +13
public class MainApp {
public static void main(String[] args) {

Machine[] machines = {new Truck(), new Bulldozer(), new Excavator()};

for (Machine machine : machines) {
machine.doWork();
machine.stopWork();
}

}

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 lines after the class declaration and method signature. According to the checklist, there should not be empty lines in these places.


@Override
public void doWork() {
System.out.println("Truck started its work.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message 'Truck started its work.' could be more informative. According to the checklist, it should indicate what type of Machine is working. Consider including the class name in the message.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

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 also be more informative. Include the class name in the message to clearly indicate which Machine has stopped working.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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 adhering to the task requirements! 👍 Remember to always ensure that method implementations like doWork and stopWork are descriptive of the actions specific to each Machine subclass. This will make your code more readable and maintainable. Keep up the good work! 🌟

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@Override
public void doWork() {
System.out.println("Bulldozer started its work.");

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. While 'Bulldozer started its work.' is somewhat informative, consider specifying the action it performs, for example, 'Bulldozer is pushing earth.' to make it more informative.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the stop message could be more informative. Instead of 'Bulldozer stopped working.', you could use 'Bulldozer has finished pushing earth.' to provide more context.


@Override
public void doWork() {
System.out.println("Excavator started its work.");

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's an Excavator that is working. Consider specifying the type of machine in the message.


@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

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's recommended to specify that it's an Excavator that has stopped working.


@Override
public void doWork() {
System.out.println("Truck started its work.");

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 making the message more informative to reflect that this is a Truck specifically.


@Override
public void stopWork() {
System.out.println("Truck stopped working.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, make the stop message more informative to indicate that it is the Truck that has stopped working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants