Working with Inheritance

 

This exercise will provide some practice working with inheritance in Java.

Starting Point

Download Server.java and open it in an IDE. In main there are 2 sections. The first section, which calls runIt(), is ready to run. The second section is commented out.

Follow the instructions in the Java file to complete the classes RestaurantWorker, Chef, PastryChef and Server. Chef inherits from RestaurantWorker, and PastryChef inherits from Chef. Server inherits from Restaurant Worker.

When your program is complete, the output should look somewhat like this:


 

Then try exercises 1 - 7, which are initially commented out in main. You can write your answers to the questions directly in the Java file, and then submit the Java file when you're done.