Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding SortedSet

 
Maddukuri Sudheer
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one help me wORKING WITH Sorted Collections Objects.My requirement is to sort among an unlimited objects and get the first 6 in descending Order.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should read something about the Comparable interface and the Comparator class. Here is one tutorial :
http://www.onjava.com/pub/a/onjava/2003/03/12/java_comp.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic