- Create class Machine containing methods
public abstract void doWork()andpublic abstract void stopWork(). - Create classes
Truck,Bulldozer,Excavatorthat will inherit fromMachine. - 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
MainAppclass createMachinearray withTruck,BulldozerandExcavatorand call methodsdoWork()andstopWork()in a loop.
vaniii1/jv-oop
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|