Multi-dimensional Array in Java?

K

kk_oop

Hi. I tried to post this once, but something went wrong in my browser. I apologize if this is a duplicate post.

I need to store a series of numbers in a two-dimensional lookup table. Basically, it'll be preset to static final values and
accessed by two indicies. Any standard Java approach for this? I'd like to use an ArrayList over an array for bounds safety
reasons. Is that the way to go, or is there a better approach?

I'm new to Java, and I know it has a huge API, so I'm just looking for pointers--or I guess I should say references. Heh heh.

Thanks,

Ken
 
L

Liz

kk_oop said:
Hi. I tried to post this once, but something went wrong in my browser. I
apologize if this is a duplicate post.
I need to store a series of numbers in a two-dimensional lookup table.
Basically, it'll be preset to static final values and
accessed by two indicies. Any standard Java approach for this? I'd like
to use an ArrayList over an array for bounds safety
reasons. Is that the way to go, or is there a better approach?

I'm new to Java, and I know it has a huge API, so I'm just looking for
pointers--or I guess I should say references. Heh heh.
Thanks,

Ken

I use this and java checks the bounds for me automatically.

final static String[][] COPTIONS =
{ { "Stop", "b000"+BBLUE1+","+BBLACK }, {
"Pause", "c000"+BBLUE1+","+BBLACK }, {
"Step Forward", "r001"+BBLUE1+","+BBLACK }, {
and so on...... }}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top