Foreach语法
先看例子:
Random rand = new Random(47);float f[] = new float[10];for(int i = 0; i < 10; i++){f[i] = rand.nextFloat();}for(float x: f) {System.out.println(x);}foreach語法:
for(float x: f) {System.out.println(x);}轉載于:https://www.cnblogs.com/wiessharling/p/3323317.html
總結
- 上一篇: StreamWriter类的一般使用方法
- 下一篇: [转载] 财经郎眼20120423:长点