Smells like homework, but a few suggestions -
- there's no reason for your Hashmap to be of the form
`<String,Object>` - make it `<String, String[][]>` , as that's what
you're storing.
You're iterating twice. You either - iterate through the map, either the keys, values or entries. Each item is an iterator return value, e.g.
for (String[][] s:map.values()){
...
}
- hashmap.values.toArray gives you all of the contents, which is the
same thing your iterator is doing.
- if you're only iterating through the contents, then you're not really
using a map, as you're never making use of the fact that your values
are available by key.
Smells like homework, but a few suggestions -
- there's no reason for your Hashmap to be of the form `<String,Object>` - make it `<String, String[][]>` , as that's what you're storing.
You're iterating twice. You either
- iterate through the map, either the keys, values or entries. Each item is an iterator return value, e.g.
for (String[][] s:map.values()){
...
}
- hashmap.values.toArray gives you all of the contents, which is the same thing your iterator is doing.
- if you're only iterating through the contents, then you're not really using a map, as you're never making use of the fact that your values are available by key.