Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conception question

 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic