my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interrupted Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Interrupted Exception" Watch "Interrupted Exception" New topic
Author

Interrupted Exception

sun par
Ranch Hand

Joined: Oct 03, 2002
Posts: 257
Can anyone clarify when Interrupted exception is thrown in the case of wait method?
Thanks
sun par


Sunita<br />SCJP 1.4
Vin Kris
Ranch Hand

Joined: Jun 17, 2002
Posts: 154
This is what the java documentation sez -
Thrown when a thread is waiting, sleeping, or otherwise paused for a long time and another thread interrupts it using the interrupt method in class Thread.
For example, consider a Scheduler that performs a job periodically. The scheduler waits from one schedule time to the next, performs the action and again waits. Say, This scheduler has to be stopped. The interrupt() method could be invoked on this thread object and the catch(InterruptedException) block can exit from the run() method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interrupted Exception
 
Similar Threads
sleep method
Thread exceptions
Sleep method cannot be interrupted? Is it true?