需要的话,可以自己实现一个Comparator

解决方案 »

  1.   

    int数组用得着使用Comparable吗?
                int[] aaa = {4,5,2,3,6};
                Arrays.sort(aaa);
    这样不就行了吗?
      

  2.   

    如果想比较数组的话,直接写一个class将int数组包起来
    public class test implements Comparable{
        private int[] ccc = {1,3,4,5};    public int[] getCCC() {
            return this.ccc;
        }
        
    public int compareTo(Object obj) {
                if (obj instanceof test) {
                int[] temp = ((test) obj).getCCC();
                这里写比较用的代码.
    }
           
                  return -1;
    }
    }