In this code:
Random random = new Random(441287210);
for(int i=0;i<10;i++)
System.out.print(random.nextInt(10)+" ");
}
The output is 1 1 1 1 1 1 1 1 1 1
, every time.
Why is this? Isn't Random
supposed to be... well... random? I thought that the Random
class use System.nanoTime
, so the output should be generally random. Can someone please explain?