這裏我的代碼,在我的scheduleAtFixedRate方法中,我放了延遲時間來開始運行該方法。但這個延遲時間不能工作和運行立刻
static ScheduledExecutorService scheduler = null;
scheduler.scheduleAtFixedRate(new Testing(),60, 24*60*60,TimeUnit.SECONDS);
public static Runnable Testing()
{ System.out.println("Testing...");
}
我想打電話給了Runnable()方法60幾秒鐘之後,但是當我運行的代碼就立刻調用此方法。 我的代碼中是否有任何問題。 我是新的scheduleAtFixedRate方法。 謝謝:)
什麼是Runnable?靜態類或方法 – Arjit
Sry,我再次編輯。 – Alice
不從測試返回可運行類型() – Arjit