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

Oop basics #2212

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

Oop basics #2212

wants to merge 4 commits into from

Conversation

NataBurtnyk
Copy link

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.

Hello! 😊 You've done a great job implementing the classes and their methods. However, there are a couple of critical issues in the MainApp class that need to be addressed before we can approve the pull request:

  1. Method Name Typo: The method name mail should be corrected to main to ensure it serves as the entry point of the application.

  2. Loop Condition Error: The loop condition i <= machines.length should be changed to i < machines.length to prevent an ArrayIndexOutOfBoundsException.

Once these issues are resolved, your code will be in great shape! Keep up the good work, and don't hesitate to reach out if you need any help. 🚀

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

@@ -2,4 +2,13 @@

public class MainApp {

public static void mail (String[] args) {

Choose a reason for hiding this comment

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

The method name mail seems to be a typo. It should be main to serve as the entry point of the application.

Machine [] machines = new Machine[] {
new Truck(), new Bulldozer(), new Excavator()
};
for (int i = 0; i <= machines.length; i++) {

Choose a reason for hiding this comment

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

The loop condition i <= machines.length should be i < machines.length to prevent an ArrayIndexOutOfBoundsException. The current condition will attempt to access an index equal to machines.length, which is out of bounds.

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 implementing the task requirements! 🎉 Your code meets the specifications, with the MainApp class correctly set up as the entry point and the loop condition properly implemented to avoid errors. The Machine class is well-structured as an abstract class, and the Truck, Bulldozer, and Excavator classes correctly extend it, overriding the necessary methods.

While there are no critical issues, always remember to review the comments for potential improvements. This will help you refine your skills and avoid similar issues in future projects. Keep up the good work and continue learning from each experience! 🚀

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

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