package hello;
import java.util.Random;
public class NewClass1 {
public static void main(String[] args) {
Random r = new Random();
System.out.println("随机生成:" + r.nextInt());
System.out.println("生成100以内的随机整数:" + r.nextInt(100));
System.out.println("生成随机的long整数:" + r.nextLong());
System.out.println("随机生成float小数:" + r.nextFloat());
}
}
import java.util.Random;
public class NewClass1 {
public static void main(String[] args) {
Random r = new Random();
System.out.println("随机生成:" + r.nextInt());
System.out.println("生成100以内的随机整数:" + r.nextInt(100));
System.out.println("生成随机的long整数:" + r.nextLong());
System.out.println("随机生成float小数:" + r.nextFloat());
}
}