数组的遍历

package test01;

//数组的遍历
public class TestArray02 {
public static void main(String[] args) {
int[] a = { 1, 2, 3, 4, 5 };
for (int i = 0; i < a.length; i++) {
// 上面遍历下角标
// System.out.println(i);
// 下面遍历数组
System.out.println(a[i]);
}
}
}

posted @ 2018-08-23 23:48  Monica_维维  阅读(178)  评论(0编辑  收藏  举报