hii in the following programe error is comming ..help me..
import java.util.Timer;
import java.util.TimerTask;
import java.awt.Toolkit;
import java.util.Calendar;
/**
* Schedule a task that executes once every second.
*/
public class AnnoyingBeep {
Toolkit toolkit;
Timer timer;
public AnnoyingBeep() {
toolkit = Toolkit.getDefaultToolkit();
timer = new Timer();
timer.scheduleAtFixedRate(new RemindTask(),
5000, //initial delay
1*1000); //subsequent rate
}
class RemindTask extends TimerTask {
int numWarningBeeps = 3;
long int_time;
public void run() {
if(numWarningBeeps==3)
int_time=getTimeInMillis();
if(getTimeInMillis()<=(int_time+1005))
if (numWarningBeeps > 0) {
int_time+=1005;
toolkit.beep();
System.out.println("Beep!");
numWarningBeeps--;
} else {
toolkit.beep();
System.out.println("Time's up!");
//timer.cancel(); //Not necessary because we call System.exit
System.exit(0); //Stops the AWT
thread (and everything else)
}
}
}
public static void main(
String args[]) {
System.out.println("About to schedule task.");
new AnnoyingBeep();
System.out.println("Task scheduled.");
}
}
------------
error comming is ..
D:\java_prac>javac AnnoyingBeep.java
AnnoyingBeep.java:27: cannot resolve symbol
symbol : method getTimeInMillis ()
location: class AnnoyingBeep.RemindTask
int_time=getTimeInMillis();
^
AnnoyingBeep.java:28: cannot resolve symbol
symbol : method getTimeInMillis ()
location: class AnnoyingBeep.RemindTask
if(getTimeInMillis()<=(int_time+1005))
^
2 errors
D:\java_prac>
why ? i didn't get ..i have included all the classes and it is not taking into consideration...
tell me why this phenomenon happens generally..so i will take care into future..