1 import java.util.Arrays;//必须加载 2 class Demo{ 3 public static void main(String []args){ 4 int[] arr={3,54,456,342,2798,15,78,56,95,5678,9,5}; 5 System.out.println(Arrays.toString(arr));//java打印数组,排序前[3, 54, 456, 342, 2798, 15, 78, 56, 95, 5678, 9, 5