I have an Object[] which entails lots of Objects of the type HashMap. The HashMap looks like this:
Object[]
{id=15, name=Hello}
{id=27, name=Hello}
{id=15, name=Hello}
I have tried to cast it to HashMap[], however no luck.
I would like to iterate and retrieve a list of names. Hope you can help me.
you can’t cast a array holding T1 to a array holding T2. An array in a actual object with a type of itself. This is the cause of your failure to cast.
However i doubt that you really have a HashMap array in there. The dump you are providing doesn’t look like a hashmap dump.
However to answer your original question you should do something like this:
this will print all the values on all the hashes from your array.