public class copyA{
public static void main(String args[]){
int myArray[]={1,2,3,4,5,6,7,8,9,0};
int anotherArray[]={4,3,2,1};
System.arraycopy(anotherArray,0,myArray,0,anotherArray.length);
for(int i : myArray){
System.out.println(myArray[i]);//最后结果输出 5,1,2,3,6,7,8,9,0,4 为什么出现这种排列,这样写有没有意义?
改为System.out.println(i);正常输出。4,3,2,1,5,6,7,8,9,0
}
}
}
public static void main(String args[]){
int myArray[]={1,2,3,4,5,6,7,8,9,0};
int anotherArray[]={4,3,2,1};
System.arraycopy(anotherArray,0,myArray,0,anotherArray.length);
for(int i : myArray){
System.out.println(myArray[i]);//最后结果输出 5,1,2,3,6,7,8,9,0,4 为什么出现这种排列,这样写有没有意义?
改为System.out.println(i);正常输出。4,3,2,1,5,6,7,8,9,0
}
}
}
解决方案 »
- java如何在指定时间内循环查询
- 关于类的实例化和指针的一个问题
- java 编程思想里边的一个问题
- OutputStreamWriter的问题
- 很难写,帮忙把
- 如果通过反射得到static final 字段的对象,需要对Java有一定的深入了解
- 急!!!!java进行串口通讯问题,“CommPortIdentifier.getPortIdentifiers()取得端口链表为空”的问题
- 求日期递增方法!
- 那里有jdbc-odbc.driver的数据库驱动下载,适应SQLServer2000的??
- 求“人事管理系统”代码
- String 类型 如何转成 Date 类型
- 不是说float 赋值都必须加f吗?可是本代码却不是...
改为System.out.println(i);