10/13 WTF is wrong with hashmap?


#1

import java.util.HashMap;

public class Restaurant {
public static void main(String[] args) {

HashMap restaurantMenu = new HashMap();
restaurantMenu.put("Turkey Burger", 13) ;

}

}


#2

Hi,
Can you post the link on the exercise? I can't seem to find it. Also, please format your code.


#3

u forgot after HashMap.

Here is the correct code:

HashMap<String, Integer> restaurantMenu = new HashMap<String, Integer>();


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.