ITPub博客

首页 > 应用开发 > > 为什么不能生成随机数,每次都是零

为什么不能生成随机数,每次都是零

作者:wjaning 时间:2019-10-10 17:16:44 0 删除 编辑

package game;

public class testlottery {

public static void main(String[] args) {

int b=(int)Math.random()*10;

System.out.println(b);

}

}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2983/viewspace-3141807/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-06

  • 博文量
    73
  • 访问量
    6473