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

Created class Machine and method toWork() and stopWork(), #1587

Closed
wants to merge 7 commits into from
Closed

Created class Machine and method toWork() and stopWork(), #1587

wants to merge 7 commits into from

Conversation

Eugene-Yukhimenko
Copy link

also creted classes Truck, Bulldozer, Excavator that will inherit from Machine. In those classes overrided doWork() and stopWork(), also in MainApp class created Machine array with Truck, Excavator, Bulldozer and called methods doWork() and stopWork() in a loop.

also creted classes Truck, Bulldozer, Excavator that will inherit from Machine. In those classes overrided doWork() and stopWork(), also in MainApp class created Machine array with Truck, Excavator, Bulldozer and called methods doWork() and stopWork() in a loop.
also creted classes Truck, Bulldozer, Excavator that will inherit from Machine. In those classes overrided doWork() and stopWork(), also in MainApp class created Machine array with Truck, Excavator, Bulldozer and called methods doWork() and stopWork() in a loop.
Copy link

@olekskov olekskov left a comment

Choose a reason for hiding this comment

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

Good job, approved.
Please check comments below for further tasks

Comment on lines +15 to +16


Copy link

Choose a reason for hiding this comment

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

2 unnecessary empty lines

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

Machine[] machine = new Machine[] {excavator, bulldozer, truck};
Copy link

Choose a reason for hiding this comment

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

Variables for single usage are rarely required

Suggested change
Excavator excavator = new Excavator();
Bulldozer bulldozer = new Bulldozer();
Truck truck = new Truck();
Machine[] machine = new Machine[] {excavator, bulldozer, truck};
Machine[] machine = new Machine[] {new Excavator(), new Bulldozer(), new Truck()};

@Eugene-Yukhimenko Eugene-Yukhimenko closed this by deleting the head repository Apr 10, 2024
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