-
Notifications
You must be signed in to change notification settings - Fork 1.9k
solution for oop task #2586
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
base: master
Are you sure you want to change the base?
solution for oop task #2586
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package core.basesyntax; | ||
|
|
||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line after package declaration |
||
| public class Bulldozer extends Machine { | ||
|
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line after class declaration |
||
| @Override | ||
| public void doWork() { | ||
| System.out.println("Bulldozer started work"); | ||
| } | ||
|
|
||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line between methods
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line between methods |
||
| @Override | ||
|
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line between methods
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove empty line after array initialization |
||
| public void stopWork() { | ||
| System.out.println("Bulldozer stopped"); | ||
| } | ||
|
|
||
| } | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package core.basesyntax; | ||
|
|
||
| public class Excavator extends Machine { | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| @Override | ||
| public void doWork() { | ||
| System.out.println("Excavator started work"); | ||
| } | ||
|
|
||
| @Override | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| public void stopWork() { | ||
| System.out.println("Excavator stopped"); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package core.basesyntax; | ||
|
|
||
| public abstract class Machine { | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| package core.basesyntax; | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| public class MainApp { | ||
| public static void main(String[] args) { | ||
|
Comment on lines
2
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
2
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
2
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'. |
||
| Machine[] machines = new Machine[] { | ||
| new Truck(), | ||
| new Bulldozer(), | ||
|
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| new Excavator() | ||
|
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| }; | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| for (Machine machine : machines) { | ||
| machine.doWork(); | ||
|
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| machine.stopWork(); | ||
|
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
|
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package core.basesyntax; | ||
|
|
||
| public class Truck extends Machine { | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| @Override | ||
| public void doWork() { | ||
| System.out.println("Truck started work"); | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove redundant empty line between methods. |
||
| @Override | ||
| public void stopWork() { | ||
| System.out.println("Truck stopped"); | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checklist item #1 violation: Remove redundant empty line before class closing brace. |
||
| } | ||
There was a problem hiding this comment.
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