如何安排任务定期运行?
我正在尝试一些代码以实现预定任务,并提出了这些代码。 import java.util.*; class Task extends TimerTask { int count = 1; // run is a abstract method that defines task performed at scheduled time. public void run() { System.out.println(count+" : Mahendra Singh"); count++; } } class TaskScheduling { public static void main(String[] args) { Timer timer = new Timer(); …