Question: Java please help ASAP! You dont need to test your code.(It doesn't to be 100 correct, do much as you can) I will give you
Java please help ASAP! You dont need to test your code.(It doesn't to be 100 correct, do much as you can) I will give you a thumb up if you help me

10. [8pts] Regardless of your answer to the previous question, refer to the inheritance diagram to answer the below questions. You will write the answers in the right side of the table. The first four lines are for the instanceof operator. On these four lines write either 'True' or 'False depending on what the corresponding line evaluates to. The last four lines deal with casting objects to new types. If the cast would give an error, write 'Error', if the cast would not give an error, write 'Ok'. Grocerystore store = new GroceryStore(); Write 'True' or 'False' on the below lines: Drink drink = new Drink(); Drink soda = new Soda (); Produce produce = new Produce(); Food food = new Food(); 1. produce instanceof GroceryStore 2. produce instanceof Drink 2. 3. drink instanceof Soda 3 3. 4. soda instanceof Soda Write 'Error' or 'Ok' on the below lines: 5. (Drink) soda 5. 6. (Soda) drink 6. 7. (GroceryStore) produce 8. (Produce) food 8 8. Grocery Store Food Drink Cleaning Supplies Produce Milk Soda
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
