finding duplicates in arraylist by using contains method
843789Sep 24 2009 — edited Sep 24 2009How can I find the duplicates in an arraylist by using the contains method? then I need to store every duplicate in another arraylist so lets say my arraylist is
<1,2,2,3,3,2,1,3,4,5>
so I need to find the duplicates which are 1,2 and 3 and store those duplicates in another arraylist so this arraylist will be something like this <1,2,3>
and I have to do these by using the contains method for arraylists. I know I need to override the equals method. Any help.