Arrays类

对数组a进行排序
Arrays.sort(a);

Arrays类重写了父类的tostring方法
System.out.println(Arrays.toString(a));

package com.java.test;

import java.util.Arrays;

public class TestArrays {

public static void main(String[] args) {
int[] a = new int[]{2,5,4,8};
Arrays.sort(a);
System.out.println(Arrays.toString(a));
}



}

Java Arrays类_java