removing duplicates in an array
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   New_User
Posted On:   Friday, October 11, 2002 09:51 PM


			



urgent please,
how to remove duplicates in an array
providing sample source code is appreciated and helpful
to me.

thanx.




Re: removing duplicates in an array

Posted By:   New_User  
Posted On:   Saturday, October 12, 2002 12:01 AM





i got, but is it better way to do or not..???
suggestions are most welcome.
here is the code...

String oldarray[]={"bbb","aaa","aaa"};
HashSet hset= new HashSet(Arrays.asList(oldarray));
String newarray[]=new String[hset.size()];
hset.toArray(newarray);




thanx.



About | Sitemap | Contact