787 snippets from 1632 members, and growing!
|
login
|
join
about
bytebin
members
tags
snippets
join
Snippets
Submit a Snippet
Search Snippets
New Snippets
Top Snippets
Top Tags
PHP
(143)
JavaScript
(125)
Java
(66)
VBSCRIPT
(58)
String
(44)
CSS
(31)
File
(29)
CSharp
(28)
HTML
(27)
mysql
(27)
C
(24)
VB.NET
(24)
python
(24)
CPlusPlus
(23)
groovy
(23)
New Snippets
xoops token auto ...
Detect Adblock
Concatenar campos...
fopen
Unique random key
get number of cha...
Find a File
Find a Directory
List Directory
File uploading in...
Venture Capital Jobs
New Members
mcheung63
cicero
mycodeofshailendra
nostromo
KennethCC
me
jamesmcm
Can
Kelmi
ysg
Top Members
dannyboy
sundaramkumar
mattrmiller
Pio
i_kenneth
ASmith
ctiggerf
sehrgut
bertheymans
SCoon
Home
/
Snippets
/
Removing double entries from a List
/
Comments
Removing double entries from a List
Snippet Menu
Revisions
Comments
Related Snippets
Add to Favorites
Email Snippet
Download Snippet
Print Snippet
Blog Snippet
snippet
|
revisions
|
comments
|
related
|
Add to Favorites
|
email
download
|
print
|
blog it
New Comment
Order
Wed. Dec. 27th, 2006 3:40 PM
SCoon
java.util.List is
ordered
collection, but this algorithm destroys original order of the elements.
Reply
that's true
Thu. Dec. 28th, 2006 7:06 AM
bertheymans
Yep, the order is gone.
You can use a TreeSet if you want to have the objects in the resulting list in their natural order, but if you have to keep the order of the objects as they where in the original list the code from the snippet is useless.
Reply
New Comment
You can use a TreeSet if you want to have the objects in the resulting list in their natural order, but if you have to keep the order of the objects as they where in the original list the code from the snippet is useless.