Results 1 to 2 of 2
Thread: reference to elements in array
- 12-14-2007, 11:37 AM #1
Member
- Join Date
- Dec 2007
- Posts
- 3
- Rep Power
- 0
reference to elements in array
I'm working with a username system that retrieves every ID and sees if there is a name attached to that specific ID. Since the great majority of ID's does not have a name attached to it, it takes quite some unnecessary time. To prevent this, I'd like to try the following:
int [] usedIDs = {1,6,34,69,306,486 etc...};
for (int i = 0; i < usedIDs.length; i++) {
//System.out.println(usedIDs[i]);
}
and then, to from there on handle the IDs that are filled as just an integer.
So something like:
int usedID = usedIDs[1];
int usedID = usedIDs[2];
etc.
Which of course doesn't really work. So I want it to, with increments by one, go through every instance of usedIDs[n] and pass that simple integer on to the rest of the program.
I suspect I need another loop somewhere, but anyone have any concrete ideas on how to fix this?
thanks,
- 12-14-2007, 11:56 AM #2
Member
- Join Date
- Dec 2007
- Posts
- 12
- Rep Power
- 0
Similar Threads
-
Object and reference
By katie in forum New To JavaReplies: 2Last Post: 10-19-2009, 03:45 PM -
pls help me out its critical ...... how can we use an arralylist reference
By raj reddy in forum Web FrameworksReplies: 0Last Post: 04-15-2008, 08:12 AM -
Getting the Object Reference Name
By Deathmonger in forum New To JavaReplies: 2Last Post: 03-12-2008, 02:51 PM -
problems with asigning elements of an array to a constructor
By rednessc in forum New To JavaReplies: 1Last Post: 12-14-2007, 07:25 AM -
Help with array of elements
By zoe in forum New To JavaReplies: 1Last Post: 07-24-2007, 05:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks