下次根据这个数,还要生成同样的随机数?
LZ,这有何意义?
LZ,这有何意义?
解决方案 »
- Web Services 服务端报 Non nillable element 'accountBalanceSet' is null
- SSH整合出错 Struts Problem Report?
- 代码改错
- 菜鸟请教Java的try-catch用法
- 大家帮帮忙!!
- JSF的一个异常。寻求解决方案。。
- UTF编码转为GBK编码
- struts国际化的问题!烦死我了!
- jdbc的问题
- 刚用jbuilder8,一个非常简单而恼火的问题
- Struts的<html:checkbox>选择问题
- Weblogic 8.1 配jdk1.5就跑不起来,jdk1.4就可以? 奇怪./左边的快速页面是红色的小叉...看不到.
* Sets the seed of this random number generator using a single
* <code>long</code> seed. The general contract of <tt>setSeed</tt>
* is that it alters the state of this random number generator
* object so as to be in exactly the same state as if it had just
* been created with the argument <tt>seed</tt> as a seed. The method
* <tt>setSeed</tt> is implemented by class Random as follows:
* <blockquote><pre>
* synchronized public void setSeed(long seed) {
* this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1);
* haveNextNextGaussian = false;
* }</pre></blockquote>
* The implementation of <tt>setSeed</tt> by class <tt>Random</tt>
* happens to use only 48 bits of the given seed. In general, however,
* an overriding method may use all 64 bits of the long argument
* as a seed value.
*
* Note: Although the seed value is an AtomicLong, this method
* must still be synchronized to ensure correct semantics
* of haveNextNextGaussian.
*
* @param seed the initial seed.
*/
synchronized public void setSeed(long seed) {
seed = (seed ^ multiplier) & mask;
this.seed.set(seed);
haveNextNextGaussian = false;
}