-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Dodano Machine i rozwizano zadanie z polimorfizmem #2466
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
base: master
Are you sure you want to change the base?
Conversation
mateacademy-ai-mentor
left a comment
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.
Review Summary
I’m requesting changes because a core requirement about printed messages is not met in multiple classes, which can cause tests to fail.
Critical issues to fix:
- src/main/java/core/basesyntax/Bulldozer.java: Update
doWork()to explicitly indicate starting, e.g.,System.out.println("Bulldozer started working");andstopWork()to explicitly indicate stopping, e.g.,System.out.println("Bulldozer stopped working");(matches the task requirement for start/stop wording). - src/main/java/core/basesyntax/Truck.java: Change the messages to be explicit:
doWork()→"Truck started working",stopWork()→"Truck stopped working"to comply with the requirement. Also remove the redundant blank line after the package declaration. [CHECKLIST ITEM: avoid redundant empty lines]
What you did well:
- Correct class hierarchy with
Machineas abstract and proper overrides in subclasses;MainAppdemonstrates polymorphism with aMachine[]loop.
Minor suggestions (optional):
- Ensure consistent, explicit wording across all machines (e.g., Excavator) for maximum clarity.
Once these messages are fixed, your solution should fully meet the requirements. Keep it up!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| public class Bulldozer extends Machine { | ||
| @Override | ||
| public void doWork() { | ||
| System.out.println("Bulldozer works"); |
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.
This doesn't follow the description requirement: "In those classes override doWork(), so it will print a message that a certain machine started its work." Consider printing an explicit start message, e.g. System.out.println("Bulldozer started working");
|
|
||
| @Override | ||
| public void stopWork() { | ||
| System.out.println("Bulldozer stops"); |
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.
This doesn't follow the description requirement: "Override stopWork() as well. It should print messages that certain machines stopped working." Consider printing an explicit stop message, e.g. System.out.println("Bulldozer stopped working");
| @@ -0,0 +1,12 @@ | |||
| package core.basesyntax; | |||
|
|
|||
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.
This violates the checklist item: "Please don't add redundant empty lines to your code." Remove this blank line after the package declaration to match the guideline .
| public class Truck extends Machine{ | ||
| @Override | ||
| public void doWork(){ | ||
| System.out.println("Truck works"); |
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.
This violates the description requirement: "In those classes override doWork(), so it will print a message that a certain machine started its work." The current message "Truck works" is not explicit about starting — consider System.out.println("Truck started working"); or "Truck started its work" .
|
Poprawki |
|
Finalne poprawki |
slade13
left a comment
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.
You're trying to make PR from neuklearna:master to mate-academy:master. Please always make PR from your newly created feature branch like 'add-machines-implementationinstead using yourmain`.
Do not make commit messages in Polish! Be aware to always use English in this course.
Great job!
No description provided.