Hashmap method not accepting defined parameters
Posted
by
Ocasta Eshu
on Stack Overflow
See other posts from Stack Overflow
or by Ocasta Eshu
Published on 2012-03-30T17:03:53Z
Indexed on
2012/03/30
17:29 UTC
Read the original article
Hit count: 176
My assignment is to implement a contact list in a HashMap. All has gone well except for the problem in the code below. the HashMap method put(K key, V value) isnt accepting the defined parameters String, List.
public ContactList(){
private HashMap<String, List<String>> map;
public void update(String name, List<String> number){
this.map.put(name, number)
The error is:
The method put(String, List<String>) is undefined for the type ContactList
How do I correct this?
© Stack Overflow or respective owner