Skip to content

Commit

Permalink
fixed code style and Readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBogusevich committed Aug 10, 2023
1 parent 24f8901 commit 00ae7d8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# jv-oop

- Create class core.basesyntax.Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`.
- Create classes `core.basesyntax.Truck`, `core.basesyntax.Bulldozer`, `core.basesyntax.Excavator` that will inherit from `core.basesyntax.Machine`.
- Create class Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`.
- Create classes `Truck`, `Bulldozer`, `Excavator` that will inherit from `Machine`.
- In those classes override `doWork()`, so it will print message that certain machine started its work.
- Override `stopWork()` as well. It should print messages that certain machine stopped its work.
- In `MainApp` class create `core.basesyntax.Machine` array with `core.basesyntax.Truck`, `core.basesyntax.Bulldozer` and `core.basesyntax.Excavator` and call methods `doWork()` and `stopWork()` in a loop.
- In `MainApp` class create `Machine` array with `Truck`, `Bulldozer` and `Excavator` and call methods `doWork()` and `stopWork()` in a loop.

#### [Try to avoid these common mistakes, while solving task](https://mate-academy.github.io/jv-program-common-mistakes/java-core/oop/oop)
5 changes: 2 additions & 3 deletions src/main/java/core/basesyntax/Bulldozer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

public class Bulldozer extends Machine {
public void doWork() {
System.out.println("core.basesyntax.Bulldozer started its work");
System.out.println("Bulldozer started its work");
}

public void stopWork() {
System.out.println("core.basesyntax.Bulldozer stoped its work");
System.out.println("Bulldozer stoped its work");
}

}
5 changes: 2 additions & 3 deletions src/main/java/core/basesyntax/Excavator.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package core.basesyntax;

public class Excavator extends Machine {

public void doWork() {
System.out.println("core.basesyntax.Excavator started its work");
System.out.println("Excavator started its work");
}

public void stopWork() {
System.out.println("core.basesyntax.Excavator stoped its work");
System.out.println("Excavator stoped its work");
}
}
25 changes: 11 additions & 14 deletions src/main/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package core.basesyntax;

public class Truck extends Machine {

public void doWork() {

System.out.println("Truck started its work");
}

public void stopWork() {
System.out.println("Truck stoped its work");
}

}
package core.basesyntax;

public class Truck extends Machine {
public void doWork() {
System.out.println("Truck started its work");
}

public void stopWork() {
System.out.println("Truck stoped its work");
}
}

0 comments on commit 00ae7d8

Please sign in to comment.