We must know, we will know. -- David Hilbert
We must know, we will know. -- David Hilbert
We must know, we will know. -- David Hilbert
Originally posted by Joseph Sweet:
Right...
But why throwing an unchecked exception?
We must know, we will know. -- David Hilbert
Originally posted by Joseph Sweet:
Aren't developers supposed to throw only checked exceptions?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
We must know, we will know. -- David Hilbert
Yes, the JVM always does that for all exceptions whether they are checked or not.Originally posted by Joseph Sweet:
When code throws a RuntimeException, does the JVM look for a catch clause that might catch it?
Yes, the JVM always executes a finally clause before leaving the block where an exception was thrown. Any kind of exception, checked or unchecked. And it doesn't matter what is going to happen higher up in the invocation stack afterwards, the exception processing is always the same.If it does, does it execute the finally clause before looking for a catch clause upward in the invocation stack (if needed)?
Perhaps so. But that page is very far from saying "Don't throw unchecked exceptions".Originally posted by Campbell Ritchie:
Jesper Young, I think Jonathan Sweet read about not throwing unchecked Exceptions
here, in the Java Tutorial.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
I agreePerhaps so. But that page is very far from saying "Don't throw unchecked exceptions".
I recommend not catching Exception, Error or Throwable ...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
If you were right, Stan, there would be no use in looking at code quality, ever.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |