81,092
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
Timer t=new Timer ();
t.schedule(new TimerTask() {
public void run() {
System.out.println(getLotteryNumber());
}
}, 0,1000*60);
}
public static String getLotteryNumber(){
String s="";
Random r=new Random();
for (int i = 0; i < 5; i++) {
s+=r.nextInt(10);
}
return s;
}