2011年11月24日
摘要: public static String getChineseCharacter(long seed) throws Exception{String str = null;//保存结果int highPos,lowPOs; //高位、低位Random random = new Random(seed); //随机数生成器highPos = 176 + Math.abs(random.nextInt(39)); //计算高位数lowPos = 161 + Math.abs(random.nextInt(93)); //计算低位数byte[] b = new byte[2]; //转化为B类型b 阅读全文
posted @ 2011-11-24 22:34 星^_^風 阅读(401) 评论(0) 推荐(0) 编辑
摘要: public class RandomNumber{public static void main(String[] args) {// 使用java.lang.Math的random方法生成随机数System.out.println("Math.random(): " + Math.random());// 使用不带参数的构造方法构造java.util.Random对象System.out.println("使用不带参数的构造方法构造的Random对象:");Random rd1 = new Random();// 产生各种类型的随机数// 按均匀分布 阅读全文
posted @ 2011-11-24 22:18 星^_^風 阅读(870) 评论(0) 推荐(0) 编辑