随机数

 1 import java.util.*;//从包中调用随机生成器
 2 public class helloworld
 3 {
 4     public static void main(String[] args) 
 5     {
 6         Random a=new Random();//定义一个随机生成器
 7         a.nextInt(100);//随机生成一个100以内的数
 8         System.out.println(a.nextInt(100));
 9     }
10 }

 

posted @ 2016-05-11 15:53  明天会更好!!!!  阅读(104)  评论(0)    收藏  举报