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

finished #2160

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

finished #2160

wants to merge 1 commit into from

Conversation

Buriy88
Copy link

@Buriy88 Buriy88 commented Sep 26, 2024

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.

Great job on defining the abstract Machine class! 🎉 It looks like you've set a solid foundation for subclasses to build upon. Just remember for future tasks to make log messages as informative as possible and adhere to Java naming conventions. Keep up the good work! 👍

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

src/main/java/core/basesyntax/Bulldozer.java Show resolved Hide resolved
public class Bulldozer extends Machine{
@Override
public void doWork() {
System.out.println("Bulldozer started working");

Choose a reason for hiding this comment

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

The message in System.out.println should indicate the type of machine. Consider changing the message to something more informative like 'Bulldozer is doing its work'.

src/main/java/core/basesyntax/Bulldozer.java Show resolved Hide resolved
@@ -0,0 +1,17 @@
package core.basesyntax;

public class Excavator extends Machine{

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 class declaration as per the checklist.


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

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. According to the checklist, it should indicate what type of Machine is working. Consider specifying the action that Excavator is performing, not just that it started working.

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

public class MainApp {
public static void main(String[] args) {
Machine[] MachineArray = {new Truck(), new Bulldozer(), new Excavator()};

Choose a reason for hiding this comment

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

Variable names should start with a lowercase letter. Consider renaming MachineArray to machineArray to follow Java naming conventions.

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

public class MainApp {
public static void main(String[] args) {
Machine[] MachineArray = {new Truck(), new Bulldozer(), new Excavator()};

Choose a reason for hiding this comment

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

Use abstract references instead of specific ones where possible. Instead of Machine[] MachineArray, you should declare Machine[] machines to adhere to Java naming conventions and to be more descriptive.

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

public class Truck extends Machine{

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 class declaration (line 2). Following the checklist, we don't need extra empty lines after class declarations or method signatures.

public class Truck extends Machine{
@Override
public void doWork() {
System.out.println("Truck started working");

Choose a reason for hiding this comment

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

The message 'Truck started working' could be more informative. According to the checklist, messages 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 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 'Truck stopped working' could be more informative. It should reflect what specific action the Truck has stopped performing.

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