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

add first commit #2180

Closed

Conversation

andriizaranko
Copy link

No description provided.

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.

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;

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.

src/main/java/core/basesyntax/Excavator.java Show resolved Hide resolved
}

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 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) {

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.

src/main/java/core/basesyntax/Truck.java Show resolved Hide resolved
}

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 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.

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 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;

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");

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");

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'.

Comment on lines +7 to +9
machines[0] = new Truck();
machines[1] = new Bulldozer();
machines[2] = new Excavator();

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");

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");

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.

@andriizaranko andriizaranko closed this by deleting the head repository Oct 17, 2024
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.

2 participants