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

Create class Machine containing methods public abstract void doWork()… #2244

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

DaniilSitailo
Copy link

Create class Machine containing methods public abstract void doWork() and public abstract void stopWork().

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.

Thank you for your effort on this task! 😊 While you've made a good start by setting up the class hierarchy, there are a few critical areas that need attention to meet the core requirements:

  1. Abstract Class and Methods: The Machine class should be defined as an abstract class, and its methods doWork() and stopWork() should be abstract. This ensures that each subclass provides its own implementation of these methods.

  2. Specific Method Behavior: Each subclass (Truck, Bulldozer, and Excavator) should override the doWork() and stopWork() methods to include specific messages or behaviors that reflect the actions of each machine. Currently, these methods only call the superclass methods, which doesn't demonstrate the unique functionality expected from each subclass.

  3. Machine Array in MainApp: The MainApp class should create an array of Machine objects containing instances of Truck, Bulldozer, and Excavator. It should then iterate over this array to call the doWork() and stopWork() methods, showcasing polymorphism.

Please address these points to align the code with the task requirements. Keep up the good work, and don't hesitate to reach out if you need further guidance! 🚀

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

Comment on lines 13 to 15
public void doWork() {
super.doWork();
}

Choose a reason for hiding this comment

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

The doWork method in Truck class only calls super.doWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

Comment on lines 16 to 18
public void stopWork() {
super.stopWork();
}

Choose a reason for hiding this comment

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

The stopWork method in Truck class only calls super.stopWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

Comment on lines 21 to 23
public void doWork() {
super.doWork();
}

Choose a reason for hiding this comment

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

The doWork method in Bulldozer class only calls super.doWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

Comment on lines 24 to 26
public void stopWork() {
super.stopWork();
}

Choose a reason for hiding this comment

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

The stopWork method in Bulldozer class only calls super.stopWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

Comment on lines 29 to 31
public void doWork() {
super.doWork();
}

Choose a reason for hiding this comment

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

The doWork method in Excavator class only calls super.doWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

Comment on lines 32 to 34
public void stopWork() {
super.stopWork();
}

Choose a reason for hiding this comment

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

The stopWork method in Excavator class only calls super.stopWork(). If the task requires specific behavior for each subclass, consider adding unique functionality here.

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