2D array inside a HashMap
Hi everyone i would like to know how to access values stored in a 2D array inside a HashMap
Here is a drawing representation of the map.
So to get the KEYS I just have to execute this code:
But how can I get acces to the actual values inside the 2D Array?
this.allPeople = personInterests.keySet();
My goal is to create a treeSet and store all the elements of the first array in it, then look at the second array if any new elements are detected add them to the treeset, then third array and so on.
I tried this code:
Object bands = personInterests.values().toArray();
for( int i=0; i<bands.length; i++)
seems to be the problem, Dealing with a 2D array, this code only return a string representation of the Arrays and not a string representation of their elements.
Using my logic I tried to execute:
But i get a ARRAY REQUIRED BUT JAVA.LANG.OBJECT FOUND
I really don't know the way to go.
Thanks to anyone that will help.