我在互联网上遇到了一段代码片段.在这里
public class Test {
public static void main(String[] args) {
Random random = new Random(441287210);
for(int j=0;j<10;j++) {
System.out.print(random.nextInt(10)+" ");
}
}
}
Run Code Online (Sandbox Code Playgroud)
每次我运行它打印1 1 1 1 1 1 1 1 1 1.这可能是有充分理由的.
为什么会出现这种行为.
这是源 - > http://www.javacodegeeks.com/2011/10/weird-funny-java.html
| 归档时间: |
|
| 查看次数: |
103 次 |
| 最近记录: |