Is there a way to implement wait(); (non-static method) in a static context. For example:
public static void getkeylist(List keylist){
for (int i=0;i<keylist.size();i++){
System.out.println(keylist.get(i));
wait(1000);
}
}
I am getting an error “Non-static method wait(long) cannot be referred from static context.”
Please help me to solve my problem. Thank you in advance.
How about
Thread.sleep(1000);waitis really used for thread control, along withnotify. I think you’re confused between the method names.