Cancelling Tasks

Report a typo

Add code to stop execution of the TimerTask named task:

public class Main {
    public static void main(String[] args) {
        Timer timer = new Timer();
        TimerTask task = new TimerCode();

        timer.schedule(task, 2000, 3000);
        _______________
    }
}
Enter a short text
___

Create a free account to access the full topic