Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

first attempt #2207

wants to merge 10 commits into from

Conversation

Ann1120-ua
Copy link

No description provided.

@@ -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`.

Choose a reason for hiding this comment

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

revert changes

Copy link
Contributor

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()`.

Choose a reason for hiding this comment

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

revert changes

Copy link
Contributor

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.");
}
}

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.");

Choose a reason for hiding this comment

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

same for all messages

Suggested change
System.out.println("core.basesyntax.Bulldozer has started working.");
System.out.println("Bulldozer has started working.");

Copy link
Contributor

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 {

Choose a reason for hiding this comment

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

Suggested change
abstract class Machine {
public abstract class Machine {

Copy link
Author

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();

Choose a reason for hiding this comment

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

check tabulation

Copy link
Author

Choose a reason for hiding this comment

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

corrected

Copy link
Contributor

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];

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

Copy link
Author

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();

Choose a reason for hiding this comment

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

remove redundant empty line

Copy link
Author

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

Copy link
Contributor

@liliia-ponomarenko liliia-ponomarenko left a 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()`.
Copy link
Contributor

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`.
Copy link
Contributor

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.");
Copy link
Contributor

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.");
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Leave only one empty line

package core.basesyntax;

abstract class Machine {
public abstract void doWork();
Copy link
Contributor

Choose a reason for hiding this comment

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

not fixed

Comment on lines 4 to 5
public static void main(String[] args) {
final int MACHINE_COUNT = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Copy link

@sarakhmen sarakhmen left a 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

Comment on lines 6 to 9
Machine[] machines = new Machine[MACHINE_COUNT];
machines[0] = new Truck();
machines[1] = new Bulldozer();
machines[2] = new Excavator();

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

Copy link
Author

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;

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

Copy link
Author

Choose a reason for hiding this comment

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

no need now

Copy link
Contributor

@liliia-ponomarenko liliia-ponomarenko left a 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() {

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

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.

4 participants