for (int i=0;i<10;i++){ int random=new Random().nextInt(100); //这儿是生成的小于100的整数,nextInt方法的参数值要是大于0的整数 System.out.println(random); }