Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java T Java TreeSet

Related Tutorials


 
 

Share on Google+Share on Google+

Java TreeSet

Advertisement
The Collection Framework provides two general-purpose implementations of the set interface

Java TreeSet

     

The Collection Framework provides two general-purpose implementations of the set interface; 
(i)HashSet 
(ii)TreeSet 
They are available in the java.util package.

TreeSet stores objects in a sorted manner. It stores its elements in a tree and they are automatically arranged in a sorted order. 

It lets you access the elements in your collection by key, or sequentially by key. 
The TreeSet implementations are useful when the developers need to extract elements from a collection in a sorted manner. 
TreeSet is not synchronized i.e. if more than one thread wants to access it at the same time then it must be synchronized externally.

Read more at:
http:/www.roseindia.net/java/jdk6/TreeSetExample.shtml

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 15, 2009

Related Tutorials

Discuss: Java TreeSet  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com