Java类似C#的foreach数组遍历

2011-11-08

View Code
 1 public class JavaApplication8 {
2
3 public static void main(String[] args) {
4 int[] b=new int[8];
5 for(int i=0;i<b.length;i++)
6 {
7 b[i]=i;
8 }
9 for(int c:b)
10 {
11 System.out.println(c);
12 }
13 }
14 }

 

posted on 2011-11-08 10:47  aolinwxfx  阅读(789)  评论(0编辑  收藏  举报

导航