Skip to content

Conversation

@SvitlanaLychagina
Copy link

overrided abstract methods in Truck, Bulldozer, Excavator classes

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.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 5 to 7
Truck truck = new Truck();
Bulldozer bulldozer = new Bulldozer();
Excavator excavator = new Excavator();

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

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.

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! ✨

Footnotes

  1. Rate AI review example

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