for循环的一个复制算法(Java)
public class ForDemo0 {
public static void main(String[] args) {
int[] num={10,20,30,40,50}; //定义一个数组
for (int i = 0; i < 5; i++) {
System.out.println(num[i]);
}
System.out.println("======================================= ");
//遍历数组元素
//将num数组每一项复制给x
for(int x:num)
{
System.out.println(x);
}
}
}