Results 1 to 3 of 3
- 09-18-2011, 03:03 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 6
- Rep Power
- 0
Stuck with a little aspect of the array list
so the scenario is an array list with elements that has been populated using the .add()
method, containing 3 variables ID fname and sname.
I can run a search using an if statement
with condition of having one of the variables equal to the search criteria, which prints
me back the search results correctly
I can refine to one search result and at that point the refined result is the details that
are the current value of the variables,
but I'm having an issue with the editing
function I can choose to change the
value of the variable but when it comes
to using the .set() method I cannot
locate the index to overwrite the data to.
any ideas on how to find the index of an arraylist element. the indexOf method
hasn't worked.
- 09-18-2011, 03:46 PM #2
Re: Stuck with a little aspect of the array list
You might not have to change the contents of the arraylist by using set. If you get a reference to an object in the arraylist, you can use its methods to change the object's contents. The updated version will stay in the arraylist if you do not remove it.
If this doesn't work, please make and post a small program that demonstrates your problem.
- 09-18-2011, 04:07 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Re: Stuck with a little aspect of the array list
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Linked List, Array List time complexity
By Rick99771977 in forum New To JavaReplies: 4Last Post: 08-18-2011, 05:37 AM -
Trying to make an array list // inserting an element to middle of array
By javanew in forum New To JavaReplies: 2Last Post: 09-06-2010, 01:03 AM -
Now stuck with inserting data into a list.
By mainy in forum New To JavaReplies: 2Last Post: 07-31-2009, 03:49 PM -
using an Array list
By toad in forum New To JavaReplies: 1Last Post: 11-18-2007, 09:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks