File tree Expand file tree Collapse file tree 7 files changed +5
-16
lines changed
main/java/core/basesyntax Expand file tree Collapse file tree 7 files changed +5
-16
lines changed Original file line number Diff line number Diff line change 11package core .basesyntax ;
2-
32public class Bulldozer extends Machine {
43 @ Override
54 public void doWork () {
65 System .out .println ("Bulldozer started working" );
76 }
8-
97 @ Override
108 public void stopWork () {
119 System .out .println ("Bulldozer stopped working" );
1210 }
13- }
11+ }
Original file line number Diff line number Diff line change 11package core .basesyntax ;
2-
32public class Excavator extends Machine {
43 @ Override
54 public void doWork () {
65 System .out .println ("Excavator started working" );
76 }
8-
97 @ Override
108 public void stopWork () {
119 System .out .println ("Excavator stopped working" );
1210 }
13- }
11+ }
Original file line number Diff line number Diff line change 11package core .basesyntax ;
2-
32public abstract class Machine {
43 public abstract void doWork ();
54
65 public abstract void stopWork ();
7- }
6+ }
Original file line number Diff line number Diff line change 11package core .basesyntax ;
2-
32public class MainApp {
43 public static void main (String [] args ) {
54 Machine truck = new Truck ();
@@ -10,10 +9,7 @@ public static void main(String[] args) {
109
1110 for (Machine machine : machines ) {
1211 machine .doWork ();
13- }
14-
15- for (Machine machine : machines ) {
1612 machine .stopWork ();
1713 }
1814 }
19- }
15+ }
Original file line number Diff line number Diff line change 11package core .basesyntax ;
2-
32public class Truck extends Machine {
43 @ Override
54 public void doWork () {
65 System .out .println ("Truck started working" );
76 }
8-
97 @ Override
108 public void stopWork () {
119 System .out .println ("Truck stopped working" );
1210 }
13- }
11+ }
You can’t perform that action at this time.
0 commit comments