Random nn = new Random();
for(int m = 0;m < 10; m++)
{
  System.out.println(nn.nextInt()%100);
}

解决方案 »

  1.   

    import java.util.Random;public class CompType
    {
    public static void main(String[] args)
    {
                      Random nn = new Random();
    for(int m = 0;m < 10; m++)
    {
      System.out.println(nn.nextInt()%100);
    }
    }
    }
      

  2.   

    util得Random和时间有关的,所以很短的时间里取是一样的。
    用java.lang.Math
    中的
    static double random() 
              Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
      

  3.   

    java是伪随机!看楼上的行不行
      

  4.   

    http://expert.csdn.net/Expert/topic/2095/2095358.xml?temp=.173916