throw exception

Posted by Unknown on Stack Overflow See other posts from Stack Overflow or by Unknown
Published on 2010-05-28T17:29:10Z Indexed on 2010/05/28 17:31 UTC
Read the original article Hit count: 225

Filed under:
|

Why can't you throw an InterruptedException in the following way:

try {
    System.in.wait(5) //Just an example
} catch (InterruptedException exception) {
    exception.printStackTrace();
 //On this next line I am confused as to why it will not let me throw the exception
    throw exception;
}

I went to http://java24hours.com, but it didn't tell me why I couldn't throw an InterruptedException.
If anyone knows why, PLEASE tell me! I'm desperate! :S

© Stack Overflow or respective owner

Related posts about throw

Related posts about interruptedexception