Question: The code below has just one error. If you delete just one keyword in the code, there is no error. Write the keyword that needs
The code below has just one error. If you delete just one keyword in the code, there is no error. Write the keyword that needs to be deleted.
import java.util.*;
class Pizza { ArrayList
public void removeTopping(String topping) { toppings.remove(topping); } }
public class Test extends Pizza{ public void addTopping(String topping) { System.out.println("cannot add topping"); }
public static void main(String[] args) { Pizza pizza = new Pizza(); pizza.addTopping("peperoni"); pizza.addTopping("mushroom"); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
