KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > util > TimerTask

java.util
Class TimerTask

java.lang.Object
  extended by java.util.TimerTask
All Implemented Interfaces:
Runnable
See Also:
Top Examples, Source Code, Timer

public boolean cancel()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public abstract void run()
See Also:
Runnable
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[116]Schedule a task
By Anonymous on 2003/10/28 06:45:13  Rate
import java.util.*; 
  
  
 public class hello {  
   public static void main ( String args [  ]  )  
        throws java.io.IOException {  
     TimerTask task = new TimerTask (  )  {  
       public void run (  )  {  
         System.out.println ( "Hello" ) ; 
       }  
    } ; 
   Timer timer = new Timer (  ) ; 
   timer.schedule ( task, yourDate ) ; 
   ..........; 
   ..........; 
   timer.cancel (  ) ; 
    }  
  } 


public long scheduledExecutionTime()
See Also:
Date.getTime()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected TimerTask()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags