定时器
import java.util.Timer;
import java.util.TimerTask;
import java.util.Date;
public class jzw
{
public static void main(String[] args)
{
new Timer().schedule(new TimerTask(){
@Override
public void run()
{
System.out.println("Bombing!");
}
}
,10000,3000);
//过3秒炸一下
//10秒炸一下
/*
while(true)
{
System.out.println(new Date().getSeconds());
try{
Thread.sleep(1000);
}catch(InterruptedException e)
{
e.printStackTrace();
}
}
*/
}
}