TimerTask的延时是在执行run函数前还是run函数后面?
还有
pubic void run()
{
abc(这里能不能传参数);
}
參考答案:可以这么写:
Timer m_Timer = new Timer();
m_Timer.schedule(m_TimeTask,durance,ST_FPT_Time);
TimerTask m_TimeTask=new TimerTask()
{
public void run()
{
try {
doStuff();
}
catch(Exception e)
{
handleException();
}
finally
{
somethingDoneFinally();
}
}
};