Is it possible to call a method in java at specific time? For example of I have a piece of code like this:
class Test{
public static void main(String args[]) {
// here i want to call foo at : 2012-07-06 13:05:45 for instance
foo();
}
}
How this can be done in java?
Using a java.util.Timer class you can create a timer and schedule it to run at specific time.
Below is the example: