Mega Code Archive

 
Categories / Java Book / 007 Thread Conncurrent
 

0406 ThreadLocalRandom

ThreadLocalRandom is a random number generator that can be accessed from the current thread only. int r = ThreadLocalRandom.current().nextInt(20, 40);