摘要: 要产生随机数,可以使用Java api中java.lang包中的Math类.Math类以静态方法的方式提供常用的数学方法, 其中Math.random()方法是一个可以产生[0.0,1.0]区间内的一个双精度浮点数的方法 如: 产生一个100以内的整数:int x=(int)(Math.random... 阅读全文
posted @ 2015-12-17 08:43 刘某人丶 阅读(227) 评论(0) 推荐(0) 编辑
摘要: package com.hanqi1;import java.util.Random;public class Test { public static void main(String[] args) { String str1 = "字符串常量"; //字符串... 阅读全文
posted @ 2015-12-17 08:36 刘某人丶 阅读(145) 评论(0) 推荐(0) 编辑