store information and only retrieve unique information.

im supposed to retrieve org_id and store it into array list.. and then i want to make sure that only unique org_id are retrieved so that only unique org_id are displayed in the table.

however, when i tried to store the org_id inside arraylist.

ArrayList list = new ArrayList();

list.add(o.getORG_ID());

it says "unchecked or unsafe operations"

and i dont know how to compare whether the org_id is unique or not.

can anyone help me on this =)

thanks!

Message was edited by:

KarenCW

[542 byte] By [KarenCWa] at [2007-11-27 11:10:26]
# 1

Why an ArrayList? Use a HashSet<T> or TreeSet<T> where T is your class.

ejpa at 2007-7-29 13:41:44 > top of Java-index,Java Essentials,Java Programming...
# 2

im sorry..im not familiar with neither HashSet nor Tree..

care to give direction?

oh,btw, im using netbeans. so im not sure whether the code can be used. =)

appreciate ur code.

KarenCWa at 2007-7-29 13:41:44 > top of Java-index,Java Essentials,Java Programming...
# 3

> care to give direction?

Care to look up the Javadoc? I do. Every day. I recommend it.

ejpa at 2007-7-29 13:41:44 > top of Java-index,Java Essentials,Java Programming...
# 4

will do. thanks btw!

KarenCWa at 2007-7-29 13:41:44 > top of Java-index,Java Essentials,Java Programming...