java - Converting Object[] into Hashmap -


i have function generate reports receives following arguments

public void generatereport(string[] headers, object[] data) 

i tried running following code

hashmap<string, string>[] hmap = (hashmap<string, string>[]) data;  collection c = hmap.values(); iterator itr = c.iterator();     while(itr.hasnext())   system.out.println(itr.next()); 

output error:

cannot find symbol [error] symbol  : method values() [error] location: class java.util.hashmap<java.lang.string,java.lang.string>[] 

hmap array of hashmaps, not hashmap, has no values() method. need hmap[i].values() access values() of i'th hashmap in array.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -