random.java
来自「基于netbeans的java桌面应用程序合集」· Java 代码 · 共 40 行
JAVA
40 行
/*
* random.java
*
* Created on 2007年10月14日, 下午3:15
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.Adam;
import java.util.Random;
/**
*
* @author Administrator
*/
public class random extends Random{
public float seed=0;
/** Creates a new instance of random */
public random() {
}
public void Random(int seed) {
setSeed(seed);
// return seed;
}
public void setSeed(long seed) {
this.seed = (seed * 10) ;
System.out.println(seed);
// haveNextNextGaussian = false;
}
public static void main(String[] args) {
Random seed=new Random();
seed.setSeed(100);
System.out.println(seed.nextInt(7));
System.out.println(seed.nextInt(8));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?