- Create class Machine containing methods
public abstract void doWork()andpublic abstract void stopWork(). - Create classes
Truck,Bulldozer, andExcavatorthat will inherit fromMachine. - In those classes override
doWork(), so it will print a message that a certain machine started its work. - Override
stopWork()as well. It should print messages that certain machines stopped working. - In the
MainAppclass create aMachinearray withTruck,Bulldozer, andExcavatorand call methodsdoWork()andstopWork()in a loop.
whereisalemon-lab/jv-oop
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|