I want to store a data structure thats a table with one column Strings and another column of Ints.
List<Entry<String, Integer>> li = new LinkedList<Entry<String, Integer>>();
would do the job for a list but I would rather have the performance of and need the memory of an array.
I tried
Entry<String, Integer>[] = new Entry<String, Integer>[10];
but that doesn’t seem to work.
Is Entry the right datatype to use?
If you really need an array of generic types, you can do this:
It gives you a compilation warning though. You can read more about it here:
http://www.devarticles.com/c/a/Java/Wildcards-Arrays-and-Generics-in-Java/2/