List list;list 里有5个值1,2,3,4,5.有个需求要排序成1,2,3,5,4.我写了个比较方法cmp,然后调用list(cmp),就是不行.哪位大神教一下我怎么写这个cmp方法,让4排在最后面.我写的cmp方法. 菜鸟急求public static int cmp(int a, int b){if (a == b)return 0;else if (a == 4 || b == 4){return -1;}elsereturn (a - b);}