well your best bet is to make a tree set then make a comparable method to sort then
for the comparable use:
public interface Comparable<int>{
public int compareTo(int a);
}
then for the class
public class anyClass implements Comparable<int>{
int[] myInts = (//add all the ints you want to sort here);
public int compareTo(int a){
return (this - int); //you can choose whatever you want
}
public static void main(String[] args) {
Collection myCollection = new TreeSet()<int>;
for(int int1 : myInts){
myCollection.add(int1);
}for(int int2 : myCollection){
System.out.println(int2);
}
}
}
that should work if not just tweak the compare to method till it does if the int doesnt work just change the <int> to <Integer> what u want hope that helped also look at:
Java 2 Platform SE v1.3.1: Interface Comparable