-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Solution #2595
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 #2595
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,11 @@ | ||
| 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. Checklist violation: redundant empty line after class declaration. Remove the empty line on line 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 violation: redundant empty line after class declaration. 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 violation: redundant empty line after class declaration. |
||
| public class Bulldozer extends Machine { | ||
| public void doWork() { | ||
|
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 violation: redundant empty line after method signature. |
||
| System.out.println("Bulldozer started its 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 violation: redundant empty line after method closing brace. 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 violation: redundant empty line after method closing brace. |
||
|
|
||
| public void stopWork() { | ||
| System.out.println("Bulldozer stopped working"); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| 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. The checklist explicitly states to avoid redundant empty lines 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. The checklist explicitly states to avoid redundant empty lines 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. The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line. |
||
| public class Excavator extends Machine { | ||
| public void doWork() { | ||
| System.out.println("Excavator started its 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. The checklist explicitly states to avoid redundant empty lines 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. The checklist explicitly states to avoid redundant empty lines 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. The checklist explicitly states to avoid redundant empty lines after method signature. Remove this empty line. |
||
|
|
||
| public 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. The checklist explicitly states to avoid redundant empty lines after class declaration. Remove this empty line. |
||
| System.out.println("Excavator stopped working"); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package core.basesyntax; | ||
|
|
||
| public abstract class Machine { | ||
| public abstract void doWork(); | ||
|
|
||
|
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. The task requires creating a
Comment on lines
+4
to
+5
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 - this follows the 'Bad example' pattern from the checklist. |
||
| public abstract void stopWork(); | ||
| } | ||
|
Comment on lines
+6
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. Redundant empty line after method declaration - this follows the 'Bad example' pattern from the checklist.
Comment on lines
+6
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. Redundant empty line after method declaration - this follows the 'Bad example' pattern from the checklist. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| package core.basesyntax; | ||
|
|
||
| public class MainApp { | ||
| public static void main(String[] args) { | ||
| Machine truc = new Truck(); | ||
| truc.doWork(); | ||
| truc.stopWork(); | ||
|
|
||
| Machine bulldozer = new Bulldozer(); | ||
| bulldozer.doWork(); | ||
| bulldozer.stopWork(); | ||
|
|
||
| Machine excavator = new Excavator(); | ||
| excavator.doWork(); | ||
| excavator.stopWork(); | ||
|
Comment on lines
+4
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. The description requires creating a 'Machine array' and calling methods 'in a loop'. Currently, three separate variables are used instead of an array, and there is no loop. This doesn't demonstrate polymorphism as intended. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| 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. Checklist violation: redundant empty line after class declaration. Remove this empty line as per the 'Bad example' pattern in the checklist. |
||
| public class Truck extends Machine { | ||
| public void doWork() { | ||
| System.out.println("Truck started its 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 violation: redundant empty line after method declaration. Remove this empty line as per the checklist guidelines. |
||
|
|
||
| public void stopWork() { | ||
| System.out.println("Truck stopped working"); | ||
| } | ||
| } | ||
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 violation: redundant empty line after class declaration. Remove the empty line on line 2.