Java并发编程--ThreadLocalRandom类原理剖析

文章目录 1. Random类及其局限性 2. ThreadLocalRandom 3. 源码分析 (1). ThreadLocalRandom current()方法 (2). int nextInt(int bound)方法 4.原理 1. Random类及其局限性 ​  Random生成随机数需要一个默认的种子,是一个long类型的数字. 生成新的随机数需要两个步骤: 现根据老的种子生成新的
相关文章
相关标签/搜索