This post has been reposted in “Data Structures”
I have a headache already trying to figure out what’s wrong with the code. I would really appreciate it SO MUCH if anyone could tell me what’s going on, why am I getting an error when I try this code.
import java.util.HashMap;
public class Restaurant {
public static void main(String[] args) {
HashMap<String, Integer> restaurantMenu = new HashMap<String, Integer>();
restaurantMenu.put("Turkey Burger", 13);
restaurantMenu.put("Naan Pizza", 11);
restaurantMenu.put("Cranberry Kale Salad", 10);
System.out.println(restaurantMenu.get ("Naan Pizza"));
}
}