searching arraylists in java

Discuss Programming

searching arraylists in java

Postby [root@localhost /]# » Wed Jun 16, 2004 9:14 pm

I need to fingure out how to search through an arraylist for an instances of a certain class.

I know that objects removed from an arraylist have to be casted. to be used,

but can it be done, in java.
[root@localhost /]#
user
user
 
Posts: 15
Joined: Wed Dec 03, 2003 8:12 pm

Postby ZiaTioN » Fri Jun 18, 2004 11:55 am

Well to simply search and return a specific element using the get() or set() functions of a java arraylist is feasable but if you plan on altering the state of the list by adding or removing a node or element then using a link list would be a better choice.

I think this link here http://www.idevelopment.info/data/Progr ... ample.java will help you out a bit.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests