Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Put certain elements of an arraylist of arrays into a hashset

807591Jun 9 2008 — edited Jun 9 2008
I have an arraylist of arrays. I now need to create a separate list that contains unique combinations of only 3 values contained in the underlying array in the arraylist. I think I can use a HashSet. I am just not sure how to create the HashSet?

I could create an ArrayList of just those 3 values and then use the add method but again I'm not sure how to create the ArrayList based on sub-elements of the original ArrayList. (i.e. copy three "variables" from the array in the arraylist to the new array for each member of the arraylist.)

Any help would be greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 7 2008
Added on Jun 9 2008
6 comments
475 views