Web Hosting Talk







View Full Version : V. URGENT How do you make 2D array in java?


death_entry
03-08-2004, 09:44 AM
Im doing a project about a leisure centre and where the members have ids, they have gates that add or deny them permssion, when they are granted access, their location (zone) gets updated, so if a user is moving from the siwmming pool (zone2) to the sauna (zone3) then the zone value changes.


I want to be able to make a non-fixed 2D array that needs to store the following. Im using bluej ide if that makes a difference.

Idnumber------Zone
101----------------1
102----------------1
103----------------3

I need to be able to update the zone value how do u do this also. So it says something like find idnumber 101 and change the value next to it

please paste code if u know how to do it

ilyash
03-08-2004, 08:11 PM
int[][] NAME = new int[104][4];
NAME[101][1] = XX;
NAME[102][2] = XX;
NAME[103][3] = XX;

i think thats what u wanted...

Brightadmin
03-15-2004, 09:48 AM
Hi,

Refer the following URLs for Two Dimensional Arrays in Java. Here 2 D Arrays are given with examples and hoping you will get enough details from this URLs

1. http://www.scism.sbu.ac.uk/jfl/Chapter13/chap13p1.html

2. http://www.vovisoft.com/java/JavaLecture/Week02/42%20Initializing%20Two%20Dimensional%20Arrays%20in%20Java.htm

3.http://sophia.dtp.fmph.uniba.sk/javastuff/javacourse/week2/33.html

Regards,

Bright:)

cleaver
03-16-2004, 06:26 PM
I'm not sure exactly what you are trying to do, but...

A HashTable might be what you are looking for.