public static void main(String[] args) {
try{
/* getByCaseSnParamMap(); */
}catch(Exception e){
e.printStackTrace();
}
int x;//定义两变量
Random ne=new Random();//实例化一个random的对象ne
x=ne.nextInt(9999-1000+1)+1000;//为变量赋随机值1000-9999
System.out.println("产生的随机数是:"+x);//输出
}
生成四位数随机数
最新推荐文章于 2025-05-15 09:34:38 发布