tag:blogger.com,1999:blog-8712770457197348465.post3704026590817890028..comments2024-03-29T03:17:04.645-07:00Comments on Javarevisited: Difference between List and Set in Java Collection? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-8712770457197348465.post-85492649907422837592013-02-17T20:24:16.429-08:002013-02-17T20:24:16.429-08:00What does ConcurrentSkipList do, does it also impl...What does ConcurrentSkipList do, does it also implement List interface ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-5807069792609693402012-11-18T08:39:53.893-08:002012-11-18T08:39:53.893-08:00if u want ordered collection with unique elements
...if u want ordered collection with unique elements<br />go for LinkedHashSet.Sirajhttps://www.blogger.com/profile/16616166348049664430noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-86201241528080561492012-08-29T12:24:35.505-07:002012-08-29T12:24:35.505-07:00Another important difference to note is the comple...Another important difference to note is the complexity of insertion. List is repetitive collection, so if you gotta insert, just insert at a particular node. But set on the other hand is unique and hence it has to validate before insertion. So this makes the Set bit slower than the listAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-33718072100346843672012-05-22T23:24:36.393-07:002012-05-22T23:24:36.393-07:00@Anonymous
If you need ordered collection with uni...@Anonymous<br />If you need ordered collection with unique elements than consider using LinkedHashSet which is not a List but a Set implementation with combination of hashtable and LinkedList and maintains insertion order or elements (order on which elements are inserted into Set) just like List interface.LinkedHashSethttp://docs.oracle.com/javase/6/docs/api/java/util/LinkedHashSet.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-20017011789870890332012-04-25T06:36:28.688-07:002012-04-25T06:36:28.688-07:00@Unknow indeed this is very popular interview ques...@Unknow indeed this is very popular interview questions on Java collection framework. check here for <a rel="nofollow">difference between an ArrayList and Vector</a>.Javin @ example of hashtable in Javahttp://javarevisited.blogspot.com/2012/01/java-hashtable-example-tutorial-code.htmlnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-39206770255306171742012-04-23T06:48:49.817-07:002012-04-23T06:48:49.817-07:00I was asked this question in my last interview. Th...I was asked this question in my last interview. They also asked my for the difference between an ArrayList and Vector.Unknownhttps://www.blogger.com/profile/12478737126977360458noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-11696647637533743882012-04-20T21:12:44.252-07:002012-04-20T21:12:44.252-07:00Linkedhashset to maintain insertion order like lis...Linkedhashset to maintain insertion order like listAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62270154478780596622012-04-18T13:02:49.097-07:002012-04-18T13:02:49.097-07:00What if I need an ordered collection with unique e...What if I need an ordered collection with unique elements?<br />(Thanks for you great blog, btw!)Anonymousnoreply@blogger.com