数组的复制和排序

public class Fuzhi {
//数组的复制
 public static void main(String[] args) {
int a[]=new int[] {1,2,3,4,5,6,7,8,9};
int b[]=new int[] {11,22,33,44,55,66,77,88,99};
System.arraycopy(a, 4, b, 4, 4);
for(int x=0;xSystem.out.print(b[x]+",");
 
 }

}

------这是一条程序猿的分界线------

public class Paixu {
//数组的排序
public static void main(String[] args) {
int a[]=new int[] {1,9,2,6,3,5,4,8,7};
java.util.Arrays.sort(a);
for (int i = 0; i < a.length; i++) {
System.out.print(a[i]+"  ");
}
}
}

你可能感兴趣的:(java)