Here you can find the source of timerTask(Runnable runnable)
Parameter | Description |
---|---|
runnable | Runnable |
public static TimerTask timerTask(Runnable runnable)
//package com.java2s; //License from project: Open Source License import java.util.TimerTask; public class Main { /**/*w ww.ja v a2s .c om*/ * Wraps Runnable to TimerTask * * @param runnable Runnable * @return TimerTask */ public static TimerTask timerTask(Runnable runnable) { return new TimerTask() { @Override public void run() { runnable.run(); } }; } }