-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
first attempt #2207
base: master
Are you sure you want to change the base?
first attempt #2207
Conversation
@@ -23,7 +23,7 @@ public class Main { | |||
|
|||
#### Write informative messages in methods. | |||
- Use English only and make messages informative | |||
- The message should indicate what type of `Machine` is working right now `Truck`, `Bulldozer` or `Excavator`. | |||
- The message should indicate what type of `core.basesyntax.Machine` is working right now `core.basesyntax.Truck`, `core.basesyntax.Bulldozer` or `core.basesyntax.Excavator`. |
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.
revert changes
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.
not fixed
@@ -1,9 +1,9 @@ | |||
# jv-oop | |||
|
|||
- Create class Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`. | |||
- Create classes `Truck`, `Bulldozer`, and `Excavator` that will inherit from `Machine`. | |||
- Create class core.basesyntax.Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`. |
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.
revert changes
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.
not fixed
System.out.println("core.basesyntax.Bulldozer has 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.
remove redundant empty line
public class Bulldozer extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("core.basesyntax.Bulldozer has started 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.
same for all messages
System.out.println("core.basesyntax.Bulldozer has started working."); | |
System.out.println("Bulldozer has started 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.
not fixed (fix it everywhere)
@@ -0,0 +1,6 @@ | |||
package core.basesyntax; | |||
|
|||
abstract class Machine { |
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.
abstract class Machine { | |
public abstract class Machine { |
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.
done!
package core.basesyntax; | ||
|
||
abstract class Machine { | ||
public abstract void doWork(); |
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.
check tabulation
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.
corrected
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.
not fixed
@@ -1,5 +1,17 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainAppTest { | |||
public static void main(String[] args) { | |||
Machine[] machines = new Machine[3]; |
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.
3 is a magic number, create constant
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.
corrected this
machines[0] = new Truck(); | ||
machines[1] = new Bulldozer(); | ||
machines[2] = new Excavator(); | ||
|
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.
remove redundant empty line
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.
I tried . it does not let me remove them in intelllij idea
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.
Good job! Let’s fix a few mistakes ;)
@@ -1,9 +1,9 @@ | |||
# jv-oop | |||
|
|||
- Create class Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`. | |||
- Create classes `Truck`, `Bulldozer`, and `Excavator` that will inherit from `Machine`. | |||
- Create class core.basesyntax.Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`. |
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.
not fixed
@@ -23,7 +23,7 @@ public class Main { | |||
|
|||
#### Write informative messages in methods. | |||
- Use English only and make messages informative | |||
- The message should indicate what type of `Machine` is working right now `Truck`, `Bulldozer` or `Excavator`. | |||
- The message should indicate what type of `core.basesyntax.Machine` is working right now `core.basesyntax.Truck`, `core.basesyntax.Bulldozer` or `core.basesyntax.Excavator`. |
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.
not fixed
public class Bulldozer extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("core.basesyntax.Bulldozer has started 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.
not fixed (fix it everywhere)
System.out.println("core.basesyntax.Excavator has 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.
Leave only one empty line
package core.basesyntax; | ||
|
||
abstract class Machine { | ||
public abstract void doWork(); |
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.
not fixed
public static void main(String[] args) { | ||
final int MACHINE_COUNT = 3; |
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.
public static void main(String[] args) { | |
final int MACHINE_COUNT = 3; | |
private static final int MACHINE_COUNT = 3; | |
public static void main(String[] args) { |
Make this variable constant
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.
Please read carefully the previous mentor's comments. Not all of them are fixed
Machine[] machines = new Machine[MACHINE_COUNT]; | ||
machines[0] = new Truck(); | ||
machines[1] = new Bulldozer(); | ||
machines[2] = new Excavator(); |
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.
it could be done in 1 line using initialization values
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.
done ! thanks
@@ -1,5 +1,16 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainAppTest { | |||
private static final int MACHINE_COUNT = 3; |
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.
add empty line after this constant
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.
no need now
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.
Good job! 👍
|
||
@Override | ||
public void stopWork() { | ||
|
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.
No description provided.