Skip to content

solution for oop task#2586

Open
yashchuk-t wants to merge 1 commit into
mate-academy:masterfrom
yashchuk-t:master
Open

solution for oop task#2586
yashchuk-t wants to merge 1 commit into
mate-academy:masterfrom
yashchuk-t:master

Conversation

@yashchuk-t

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary


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

Footnotes

  1. Rate AI review example

package core.basesyntax;

public abstract class Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line after class declaration opening brace. Remove line 4 to follow the improved code style from the checklist.


public abstract void doWork();

public abstract void stopWork();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant empty line after method signature opening brace. Remove line 7 to follow the improved code style from the checklist.

Comment on lines +1 to +2
package core.basesyntax;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after package declaration

Comment on lines +3 to +4
public class Bulldozer extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after class declaration

Comment on lines +8 to +9
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line between methods

Comment on lines +1 to +2
package core.basesyntax;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after package declaration

Comment on lines +3 to +4
public class Bulldozer extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after class declaration

Comment on lines +8 to +9
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line between methods

Comment on lines +1 to +2
package core.basesyntax;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after package declaration

Comment on lines +3 to +4
public class Bulldozer extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after class declaration

Comment on lines +9 to +10

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line between methods

Comment on lines +14 to +15

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after method body

Comment on lines +2 to +3

public class Bulldozer extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after class declaration

Comment on lines +9 to +10

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line after array initialization

Comment on lines +14 to +15

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove empty line before closing brace of main method

Comment on lines 2 to +4

public class MainApp {
public static void main(String[] args) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.

Comment on lines +6 to +8
new Truck(),
new Bulldozer(),
new Excavator()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

Comment on lines +11 to +13
for (Machine machine : machines) {
machine.doWork();
machine.stopWork();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

Comment on lines 2 to +4

public class MainApp {
public static void main(String[] args) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.

Comment on lines +6 to +8
new Truck(),
new Bulldozer(),
new Excavator()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

Comment on lines +11 to +13
for (Machine machine : machines) {
machine.doWork();
machine.stopWork();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

Comment on lines 2 to +4

public class MainApp {
public static void main(String[] args) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.

Comment on lines +5 to +7
Machine[] machines = new Machine[] {
new Truck(),
new Bulldozer(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

Comment on lines +10 to +12

for (Machine machine : machines) {
machine.doWork();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after method signature. Remove this empty line.

@@ -1,5 +1,19 @@
package core.basesyntax;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after package declaration. Remove this empty line.

new Bulldozer(),
new Excavator()
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line after array initialization. Remove this empty line before the for loop.

machine.doWork();
machine.stopWork();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: redundant empty line before the closing brace. Remove this empty line.

package core.basesyntax;

public class Excavator extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.

package core.basesyntax;

public class Excavator extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.

package core.basesyntax;

public class Excavator extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.

System.out.println("Excavator started work");
}

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1 - redundant empty line after for-loop declaration. Remove this empty line.

package core.basesyntax;

public class Truck extends Machine {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove redundant empty line after class declaration. Follow the improved code style from the checklist.

public void doWork() {
System.out.println("Truck started work");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove redundant empty line between methods.

public void stopWork() {
System.out.println("Truck stopped");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: Remove redundant empty line before class closing brace.

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