multi-dimensional ArrayList
Posted
by
wishi
on Stack Overflow
See other posts from Stack Overflow
or by wishi
Published on 2011-01-14T17:30:16Z
Indexed on
2011/01/14
17:53 UTC
Read the original article
Hit count: 233
Hi!
Just a very small question... I seem to run into too much complexity here: I have to realize an index-structure like {42, someString}. I tried:
Object entry[][] = new Object[1][1];
ArrayList<Object> my_list = new ArrayList<Object>();
However that looks really strange. Isn't there a better much simpler solution to just store some Integer and a String? I need to perfrom search for the Strings and return the Integer... so I thought Collections and ArrayLists are good friends in the Java API.
© Stack Overflow or respective owner