Total Pageviews

Thursday, November 11, 2010

A simple Reminder program in JAVA with the help of TimerTask

import java.util.Timer;
import java.util.TimerTask;


public class reminder {
Timer tim;

public static void main(String[] args)
{
new reminder(1);
System.out.println("\n Timer");
}

public reminder(int i)
{
tim=new Timer();
tim.schedule(new time(), i*1000);
}

public class time extends TimerTask
{

@Override
public void run() {
System.out.println("run..");

}
}
}

No comments:

Post a Comment