四个结果都不一样,是因为赋值一次就变一次吗?怎么解释?
- import java.util.Random;
- class BuDong
- {
- public static void main(String[] args)
- {
-
- Random r = new Random(17);
- System.out.println(r.nextInt(10));
- System.out.println(r.nextInt(10));
- int num1 = r.nextInt(10);
- int num2 = r.nextInt(10);
- System.out.println(num1);
- System.out.println(num2);
- }
- }
复制代码
|
|