random用法

xiaoxiao2021-02-28  147

生成0-99的随机数

public static void main(String[] args) {

Random random = new Random(); for (int i = 0; i < 100; i++) { System.out.println(random.nextInt(1000)); }

}

结果:

75 2 1 13 50 87 84 73 28 40

转载请注明原文地址: https://www.6miu.com/read-17527.html

最新回复(0)