//数组1
int[] num={10,20,30};
//数组2
int[] sum={40,50,60};
//合并后新数组
int[] score=new int[num.length+sum.length];
//循环显示数组1
System.out.print("第一个数组中的元素:");
for (int i = 0; i < num.length; i++) {
System.out.print(num[i]+" ");
}
//循环显示数组2
System.out.print("\n第二个数组中的元素:");
for (int i = 0; i < sum.length; i++) {
System.out.print(sum[i]+" ");
}
//将第一个数组中数据复制到新数组
int i=0;
for (i = 0; i < num.length; i++) {
score[i]=num[i];
}
//将第二个数组中数据复制到新数组
for (int j = 0; j < sum.length; j++,i++) {
score[i]=sum[j];
}
//循环输出新数组
System.out.print("\n两个数组合并后:");
for (i = 0; i < score.length; i++) {
System.out.print(score[i]+" ");
}
//排序方法
Arrays.sort(score);
//逆序后
System.out.print("\n逆序后:");
for (i = score.length-1; i>=0; i--) {
System.out.print(score[i]+" ");
}
既然有电脑,就慢慢的敲下代码,有不会的再让大家帮你参考下咯