Question: Given the code below answer these questions. A. What makes the Pizza class abstract? B. In the Pizza class some variables are defined as being



Given the code below answer these questions. A. What makes the Pizza class abstract? B. In the Pizza class some variables are defined as being protected and others are defined as being private, what is the difference. What would change in the Small_Pizza class if private was used for the variable cost. C. In the compareTo method, how does the compiler know that only objects of type Pizza will be compared? D. In the class Pizza, which variables are class variables as opposed to instance variables? E. Name all the constructors that get invoked with this statement. Small_Pizza sm_pizza = new Small_Pizza(); F. A large pizza costs 10 dollars and each topping on the large pizza costs 75. Write the class for the large pizza which builds from the existing Pizza class. H 1 public class Pizzadrv { 2 public static void main(String[] args) { 3 Small_pizza sm_pizza = new Small_pizza(); 4 Pizza[] pizzas = new Pizza[4]; 5 pizzas [0] = sm_pizza; 6 } 7 } // end of Pizzadrv 8 abstract class Pizza implements Comparable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
