notjust4java
My experience in development.
Tuesday, 7 August 2012
Random number in java 7
Since java 7 you should use
ThreadLocalRandom.current().nextInt()
over
Math.random()
for generating random numbers. ThreadLocalRandom use random seed per thread, so threads do not compete for it.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment