solution for oop task#2586
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| package core.basesyntax; | ||
|
|
||
| public abstract class Machine { | ||
|
|
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Redundant empty line after method signature opening brace. Remove line 7 to follow the improved code style from the checklist.
| package core.basesyntax; | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after package declaration
| public class Bulldozer extends Machine { | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after class declaration
| } | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line between methods
| package core.basesyntax; | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after package declaration
| public class Bulldozer extends Machine { | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after class declaration
| } | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line between methods
| package core.basesyntax; | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after package declaration
| public class Bulldozer extends Machine { | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after class declaration
|
|
||
| @Override |
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line between methods
|
|
||
| } |
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after method body
|
|
||
| public class Bulldozer extends Machine { |
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after class declaration
|
|
||
| @Override |
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line after array initialization
|
|
||
| } |
There was a problem hiding this comment.
Checklist item #1 violation: Remove empty line before closing brace of main method
|
|
||
| public class MainApp { | ||
| public static void main(String[] args) { |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.
| new Truck(), | ||
| new Bulldozer(), | ||
| new Excavator() |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
| for (Machine machine : machines) { | ||
| machine.doWork(); | ||
| machine.stopWork(); |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
|
|
||
| public class MainApp { | ||
| public static void main(String[] args) { |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.
| new Truck(), | ||
| new Bulldozer(), | ||
| new Excavator() |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
| for (Machine machine : machines) { | ||
| machine.doWork(); | ||
| machine.stopWork(); |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
|
|
||
| public class MainApp { | ||
| public static void main(String[] args) { |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after class declaration. Remove this empty line following the pattern in the 'Improved example'.
| Machine[] machines = new Machine[] { | ||
| new Truck(), | ||
| new Bulldozer(), |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
|
|
||
| for (Machine machine : machines) { | ||
| machine.doWork(); |
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after method signature. Remove this empty line.
| @@ -1,5 +1,19 @@ | |||
| package core.basesyntax; | |||
|
|
|||
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after package declaration. Remove this empty line.
| new Bulldozer(), | ||
| new Excavator() | ||
| }; | ||
|
|
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line after array initialization. Remove this empty line before the for loop.
| machine.doWork(); | ||
| machine.stopWork(); | ||
| } | ||
|
|
There was a problem hiding this comment.
This violates checklist item #1: redundant empty line before the closing brace. Remove this empty line.
| package core.basesyntax; | ||
|
|
||
| public class Excavator extends Machine { | ||
|
|
There was a problem hiding this comment.
This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.
| package core.basesyntax; | ||
|
|
||
| public class Excavator extends Machine { | ||
|
|
There was a problem hiding this comment.
This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.
| package core.basesyntax; | ||
|
|
||
| public class Excavator extends Machine { | ||
|
|
There was a problem hiding this comment.
This violates checklist item #1 - redundant empty line after class declaration. Remove this empty line.
| System.out.println("Excavator started work"); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
This violates checklist item #1 - redundant empty line after for-loop declaration. Remove this empty line.
| package core.basesyntax; | ||
|
|
||
| public class Truck extends Machine { | ||
|
|
There was a problem hiding this comment.
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"); | ||
| } | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove redundant empty line between methods.
| public void stopWork() { | ||
| System.out.println("Truck stopped"); | ||
| } | ||
|
|
There was a problem hiding this comment.
Checklist item #1 violation: Remove redundant empty line before class closing brace.
No description provided.