Question: Supplied code public static void main(String[] args){ String[] toppings = {Pickles, Tomatoes, Onions}; Burger lilMark = new Burger(Lil' Mark, 2.25, true, toppings); System.out.println(lilMark); } Output
![Supplied code public static void main(String[] args){ String[] toppings = {"Pickles",](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c799b4edd_37766f3c7994dfc9.jpg)
Supplied code
public static void main(String[] args){
String[] toppings = {"Pickles", "Tomatoes", "Onions"};
Burger lilMark = new Burger("Lil' Mark", 2.25, true, toppings);
System.out.println(lilMark);
}
Output
Food: Lil' Mark
Price: $2.25
Combo: Yes
Toppings: Pickles, Tomatoes, Onions
Create the following hierarchy of classes: - An abstract superclass Food; - A class Burger, which is a concrete (i.e. non-abstract) subclass of Food; - Keep in mind that you would eventually add other subclasses of Food (but not now). Every Food should have a String name, and a double price. Every Burger should also have a boolean combo and a String[] representing its list of toppings. Write the code for the two classes, with the necessary instance variables and methods (with appropriate visibility), for the main method below to produce the output shown. When designing the two classes, avoid code duplication when possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
