2016-02-01 35 views

回答

0

你会说类似以下内容:

hm.get(string).get(integer); 

如果你把它瓜分了,是这样的:

ArrayList<Integer> arlist = hm.get(string); // This will return the string's hash map value 
int value = arlist.get(index); // This will return the ArrayList's index's element 

有关的HashMap的get()更多信息:https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html#get(java.lang.Object)

有关ArrayList的更多信息,请致电get()https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#get(int)