Robert

64%
Flag icon
As of Java 7, you should no longer use Random. For most uses, the random number generator of choice is now ThreadLocalRandom. It produces higher quality random numbers, and it’s very fast. On my machine, it is 3.6 times faster than Random.
Robert
It'd be nice to hear about what's different about it and why it's better (what is it about Random's implementation that makes it bad / how was ThreadLocalRandom able to be better?). Seems like a small ask considering how much was just put into analyzing the bad example.
Effective Java
Rate this book
Clear rating
Open Preview