Results 1 to 5 of 5
Thread: Arrays
- 12-13-2011, 10:41 AM #1
Member
- Join Date
- Nov 2011
- Location
- Australia
- Posts
- 28
- Rep Power
- 0
Arrays
Hi everyone,
I was wondering if someone could give me a hand with my problem.
So I have set up an array that has 20 positions available in it (0 - 19) and I have initialised values in the first five positions (0 - 4). Now my issue is that when I use a scanner to input data into a field it replaces the data I already have there. I think I would need to use a while or if statement and search for a "null" position and then place the new data there, but I'm not 100% sure.
Any help would be greatly appreciated.
- 12-13-2011, 11:51 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,421
- Blog Entries
- 7
- Rep Power
- 17
Re: Arrays
You could do that, but using a List of some form (ArrayList or LinkedList) would be easier.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-13-2011, 11:58 AM #3
Member
- Join Date
- Nov 2011
- Location
- Australia
- Posts
- 28
- Rep Power
- 0
Re: Arrays
Could you please enlighten me on this List method, I don't think I have ever used one before I'm still only a Java beginner.
- 12-13-2011, 12:04 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,421
- Blog Entries
- 7
- Rep Power
- 17
Re: Arrays
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-13-2011, 12:07 PM #5
Member
- Join Date
- Nov 2011
- Location
- Australia
- Posts
- 28
- Rep Power
- 0
Similar Threads
-
arrays and multidimensional arrays
By belfast09 in forum New To JavaReplies: 5Last Post: 06-14-2011, 01:28 PM -
Arrays
By sarah jain in forum New To JavaReplies: 7Last Post: 02-28-2011, 11:41 PM -
store array of arrays in array of arrays
By joost_m in forum New To JavaReplies: 4Last Post: 04-19-2010, 10:32 AM -
Arrays.sort... why sorting all arrays in class?
By innspiron in forum New To JavaReplies: 6Last Post: 03-23-2010, 01:40 AM -
Arrays
By TheRocket in forum New To JavaReplies: 6Last Post: 12-10-2008, 06:00 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks