java - Take values from ArrayList<HashMap<String, String>> -
i have problem getting value arraylist<hashmap<string, string>>
.
my code is:
arraylist<hashmap<string, string>> myarraylist;
and then:
hashmap<string, string> map = new hashmap<string, string>(); map.put(tag_id, id); map.put(tag_name, name); myarraylist.add(map);
if want name, example, tried follow obtain runtime error (the application crashes):
system.out.println(myarraylist.get(1).get(tag_name));
how can solve it?
thank much!
system.out.println(myarraylist.get(1).get(tag_name));
arraylist
0-based. get(0)
instead.
Comments
Post a Comment