首页 > 应用开发 > > 为什么不能生成随机数,每次都是零
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/ ,如需转载,请注明出处,否则将追究法律责任。