How to Schedule Thread ?
Hi Everybody,
Task : i need to execute println("some message") on specific date
Description : i am using TimerTask & Timer class to Schedule thread. But i want execution on some date. follows are code
import java.io.File;
class Demo extends TimerTask
{
public Date td;
public Demo(Date d)
{
this.td = d;
}
public void run()
{
System.out.println("Deepak singh");
}
}// End of Class
public class TimerDemo
{
public static void main(String arg[])
{
Date d1 = new Date(2007,06,27,0,1,0);
Demo d = new Demo(new Date());
Timer t = new Timer();
t.schedule(d,d1);
}
}
Note : change your system time and Date( 11:58:00 ) before executing the code and see there is no result after date achieved nothing is result.
plz help me ............................
Thanks

