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]
Subscribe to:
Post Comments (Atom)
Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez
0 comments:
Post a Comment