Thursday, June 25, 2009

How to Use Sorted Set


Elements in the TreeSet will automatically be arranged in sorted form.

// Create the sorted set
Set set = new TreeSet();

// Add elements to the set
set.add("b");
set.add("c");
set.add("a");

//[a,b,C]

0 comments:

 

Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez