This is what I tried to do, but it gives me a warning:
HashMap<String, String>[] responseArray = new HashMap[games.size()];
Type safety: The expression of type HashMap[ ] needs unchecked conversion to conform to HashMap[ ]
arrayshashmapjava
This is what I tried to do, but it gives me a warning:
HashMap<String, String>[] responseArray = new HashMap[games.size()];
Type safety: The expression of type HashMap[ ] needs unchecked conversion to conform to HashMap[ ]
Best Answer
What gives? It works. Just ignore it:
No, you cannot parameterize it. I'd however rather use a
List<Map<K, V>>
instead.To learn more about collections and maps, have a look at this tutorial.