java数组sort()方法降序方式:
用Arrays类sort()对数组元素进行降序排列
import java.util.Arrays;
class SortDemo
{
public static void main(String[] args)
{
int[] vec={0,15,-14,45,20,70};
Arrays.sort(vec);
System.out.println("/n");
System.out.println("降序排列:");
for (int i=vec.length-1;i>=0 ;i-- )
{
System.out.print(vec[i]+" ");
}
}
}