首页 > 代码库 > 141120 Random
141120 Random
pseudorandom:伪随机
maintain:保持,维持,维护
uniformly:统一的
distribute:分布,分配
maintain:保持,维持,维护
/** * Creates a new random number generator using a single {@code long} seed. * The seed is the initial value of the internal state of the pseudorandom * number generator which is maintained by method {@link #next}. * * <p>The invocation {@code new Random(seed)} is equivalent to: * <pre> {@code * Random rnd = new Random(); * rnd.setSeed(seed);}</pre> * * @param seed the initial seed * @see #setSeed(long) */ public Random(long seed) { this.seed = new AtomicLong(0L); setSeed(seed); }
uniformly:统一的
distribute:分布,分配
/** * Returns the next pseudorandom, uniformly distributed {@code int} * value from this random number generator‘s sequence. The general * contract of {@code nextInt} is that one {@code int} value is * pseudorandomly generated and returned. All 2<font size="-1"><sup>32 * </sup></font> possible {@code int} values are produced with * (approximately) equal probability. * * <p>The method {@code nextInt} is implemented by class {@code Random} * as if by: * <pre> {@code * public int nextInt() { * return next(32); * }}</pre> * * @return the next pseudorandom, uniformly distributed {@code int} * value from this random number generator‘s sequence */ public int nextInt() { return next(32); }
141120 Random
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。