Java 取六位随机数

来源:互联网 发布:mac系统可以玩的网游 编辑:程序博客网 时间:2024/04/28 20:45
//方法一 //String.valueOf(Math.ceil(Math.random()*500000+500000));//方法二        String strNum = String.valueOf(Math.floor(Math.random()*500000+500000));        System.out.println(Integer.valueOf(strNum.substring(0, strNum.indexOf('.'))));

0 0
原创粉丝点击