MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day24/code/day24_Thread/src/cn/itcast_12/TimerDemo.java:14–31  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

12 */
13public class TimerDemo {
14 public static void main(String[] args) {
15 // ����������
16 final Timer t = new Timer();
17
18 // public void schedule(TimerTask task,long delay):��delay��������task������
19 // t.schedule(new MyTask(t), 3000);
20
21 // �����ڲ���ʵ��
22 t.schedule(new TimerTask() {
23
24 @Override
25 public void run() {
26 System.out.println("ը����ը��,duang duang duang");
27 t.cancel();
28 }
29
30 }, 3000);
31 }
32}
33
34class MyTask extends TimerTask {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected