Ray's playground

 

Controlling Execution(Thinking in Java)

 1 import java.util.*;
 2 
 3 public class ForeachDemo {
 4     public static void main(String[] args)
 5     {
 6         float f[] = new float[10];
 7         Random r = new Random(34);
 8         for(int i=0; i<10; i++)
 9         {
10             f[i] = r.nextFloat();
11         }
12         
13         for(float fl : f)
14         {
15             System.out.println(fl);
16         }
17     }
18 }

 

posted on 2010-01-14 22:24  Ray Z  阅读(143)  评论(0编辑  收藏  举报

导航