-
Notifications
You must be signed in to change notification settings - Fork 1.9k
added abstract Machine class #2469
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?
added abstract Machine class #2469
Conversation
…ldozer, Excavator classes
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
Your solution is very well-structured and correctly implements the required functionality. Great job on that!
However, one change is required in MainApp.java before I can approve it. The variables for your machines are declared using their concrete types (e.g., Truck truck = new Truck();). This violates a specific requirement from the task's checklist [CHECKLIST ITEM #3], which asks you to use abstract references where possible.
Please update these declarations to use the abstract Machine type, for example: Machine truck = new Truck();. This is a fundamental concept of polymorphism that makes your code more flexible. Once you've made this adjustment, your solution will be ready!
✨ 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
| Truck truck = new Truck(); | ||
| Bulldozer bulldozer = new Bulldozer(); | ||
| Excavator excavator = new Excavator(); |
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 checklist item #3: 'Use abstract references instead of specific ones where possible'. It's a best practice to declare variables using the abstract type, for example: Machine truck = new Truck();. This makes the code more flexible by depending on the abstraction (Machine) rather than the concrete implementation (Truck, Bulldozer, Excavator).
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
Excellent work on this task! I'm happy to approve your solution. You've done a great job addressing the previous feedback by correctly using the abstract Machine type for your variable declarations in MainApp.java. This demonstrates a solid understanding of polymorphism. All classes are implemented correctly, and the entire solution now fully meets the requirements. Well done!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
overrided abstract methods in Truck, Bulldozer, Excavator classes