aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes conception question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "conception question" Watch "conception question" New topic
Author

conception question

Niu Xiuyuan
Ranch Hand

Joined: Jun 08, 2001
Posts: 68
who can tell the difference between Set interface and List interface..
i merely know that set interface can't contain the duplicate elements.


Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Trupti Samel
Greenhorn

Joined: May 15, 2001
Posts: 24
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

Joined: May 15, 2001
Posts: 24
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: conception question
 
Similar Threads
asList() doubt
Collection Interfaces
class cast exception
interview question on core java
How to check if the elements in one array are present in another array