Skip to content

Commit

Permalink
Classes Truck, Bulldozer, Excavator no public more.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeresadaKostya committed Jul 25, 2023
1 parent e6ddc94 commit faf850c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/core/basesyntax/Buldozer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

public class Buldozer extends Machine{
class Buldozer extends Machine {
@Override
public void doWork() {
System.out.println("Buldozer started work");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/basesyntax/Excavator.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

public class Excavator extends Machine {
class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator started work");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/basesyntax/Machine.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

public abstract class Machine {
abstract class Machine {
public abstract void doWork();

public abstract void stopwork();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/core/basesyntax/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package core.basesyntax;

public class MainApp {
Truck truck = new Truck();
Buldozer buldozer = new Buldozer();
Excavator excavator = new Excavator();

public void work() {
public static void main(String[] args) {
Truck truck = new Truck();
Buldozer buldozer = new Buldozer();
Excavator excavator = new Excavator();
Machine [] machine = new Machine[] {truck, buldozer, excavator};

for (int i = 0; i < machine.length; i++) {
machine[i].doWork();
machine[i].stopwork();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/basesyntax/Truck.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

public class Truck extends Machine{
class Truck extends Machine{
@Override
public void doWork() {
System.out.println("Truck started work");
Expand Down

0 comments on commit faf850c

Please sign in to comment.