This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
According to Objective 2.6 of K&B, some exceptions are thrown by the JVM and some PROGRAMATICALLY. 1. Can anyone explain how one can say that a particular EXCEPTION is thrown by JVM or thrown PROGRAMATICALLY? 2. Also though it is out of scope of SCJP, how can we decide about CHECKED exceptions, whether they're thrown by JVM or PROGRAMATICALLY ?
Thanks and Regards,
*Nothing is CONSTANT in life, except CHANGE*
Here, PROGRAMATICALLY means checked, which also means caught at compile time. There are cases for exceptions to occur which cannot be caught by the compiler due to (bad?) object states at runtime. A good example of this would be in file i/o where you try to open a file for reading that doesn't exist. The compiler doesn't know the file doesn't exist, whence at runtime, an unchecked exception is thrown.
Hope this helps. I was a little confused about this too when I started K&B (I think my eyes were glazed over at the time ). There'll be other references to checked/unchecked exceptions further in the book.
-- Nothing is impossible if I'mPossible [ October 18, 2007: Message edited by: Doug Slattery ]