mytaskmain.java

来自「java 完全探索的随书源码」· Java 代码 · 共 16 行

JAVA
16
字号
import java.util.Timer;public class MyTaskMain{  // This is the main method that starts the Timer. Notice we did not have to  // call a start method on the Timer. It actually associates a thread with  // each Timer instance  public static void main(String[] args)  {    Timer timer = new Timer();    MyTask task = new MyTask( 5, timer );    // Schedule the task to run every 3000 millisecs or 3 seconds starting    // right from the beginning.    timer.schedule( task, 0, 3000 );  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?