@tsing1226
2016-10-13T18:20:32.000000Z
字数 296
阅读 762
java
数组
两种方式:
int [] nums = new int [] {0,1,2,3,4,5,6,7,8,9};
for(int i=0;i<11;i++){
System.out.println(num[i]);
}
语法:
for(<迭代变量声明>:<数组>){
语句;
}
int [] nums = new int [] {0,1,2,3,4,5,6,7,8,9};
for (int n : nums) {
System.out.println(n);