A very simple question i guess, but i even have problem with it.
I am pretty confused with isInterrupted which in the foll program gives error.
class interruption implements Runnable{
public void run()
{
Thread y = Thread.currentThread();
for(int i=0;i<15;i++)
{
System.out.println(y.getName().isInterrupted()); //error here
}}
public static void main(
String args[]){
interruption i = new interruption();
Thread t = new Thread(i,"New");
t.start();
try{
Thread.sleep(40);
}catch(InterruptedException e) { }
t.interrupt();
System.out.println(t.isInterrupted()+" implies was interrupted in between");
try
{
Thread.sleep(200);
}catch(InterruptedException e) {}
}
}
Some where in Khalid i read that we can use statement of the form obj.make().make();
It seems i am missing some thing
So please anyone out there help me
Neelkanthan Keshavan