- 博客(1)
- 收藏
- 关注
原创 ThreadLocalRandom使用
ThreadLocalRandom使用中出现相同结果当我们在主线程中通过ThreadLocalRandom的current方法获得这个工具类的实例后,再在线程中使用这个实例的nextInt方法就会发现这些线程打印出来的结果是相同的。 public static voic main(String [] Args){` ThreadLocalRandom rd=ThreadLocalRandom.current(); Thread thread1=new Thread(new Runn
2022-01-08 23:03:18
842
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人