- Create class Machine containing methods
public abstract void doWork()
andpublic abstract void stopWork()
. - Create classes
Truck
,Bulldozer
,Excavator
that 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
Main
class creat object of each class. - Start work of all machines and then stop them.
nadhob / jv-oop Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mate-academy/jv-oop