File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conception question

 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
who can tell the difference between Set interface and List interface..
i merely know that set interface can't contain the duplicate elements.
 
Trupti Samel
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Niu,
Set Interface : It does not contain any duplicates .THe class which implements this interface is Hash set. The other interface in this relation is Sortedset Interface where the elements are sorted in a particular order.The Treeset class implements the sorted set interface.

List : List is also one the core interfaces where the elements are maintained in a particular order. List allows duplicates. The main imp is given to the order in which the elements are arranged. List Iterator is provided which iterates over this elements.
Classes which implement the List interface are Linked List,Arraylist ,Vector .
For a detailed tutorial : http://java.sun.com/docs/books/tutorial/collections/index.html
HTH,
Trupti.
 
Trupti Samel
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Niu,
Set Interface : It does not contain any duplicates .THe class which implements this interface is Hash set. The other interface in this relation is Sortedset Interface where the elements are sorted in a particular order.The Treeset class implements the sorted set interface.

List : List is also one the core interfaces where the elements are maintained in a particular order. List allows duplicates. The main imp is given to the order in which the elements are arranged. List Iterator is provided which iterates over this elements.
Classes which implement the List interface are Linked List,Arraylist ,Vector .
For a detailed tutorial : http://java.sun.com/docs/books/tutorial/collections/index.html
HTH,
Trupti.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic