//产生随机数的类 final SuiJiShuClass sjs=new SuiJiShuClass(); final JPanel panel=new JPanel(); //初始化一个JPanel panel.setBorder(BorderFactory.createTitledBorder("QQ:330936274")); //设置边界 final JTextField testnum1= new JTextField("请输入最小的数",10);//"文本框 final JTex
Math.random():获取0~1随机数
Math.floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result. (小于等于 x,且与 x 最接近的整数。)其实返回值就是该数的整数位:Math.floor(0.666) –> 0Math.floor(39.2783) –> 39
所以我们可以使用Math.floor(Math.random())去获取你想