Java exception translations
Posted
by
user3079275
on Stack Overflow
See other posts from Stack Overflow
or by user3079275
Published on 2014-08-23T04:04:10Z
Indexed on
2014/08/23
4:20 UTC
Read the original article
Hit count: 112
Apologies if this has been discussed on other threads but I find it helps clarify my thinking when I am forced to write down my questions. I am trying to properly understand the concept of checked vs unchecked exceptions and exception translation in Java but I am getting confused. So far I understood that checked exceptions are exceptions that need to be always caught in a try/catch block otherwise I get a compile time error. This is to force programmers to think about abnormal situations that might happen at run time (like disk full etc). Is this right? What I did not get was why we have unchecked exceptions, when are they useful? Is it only during development time to debug code that might access an illegal array index etc? This confusion is because I see that Error exceptions are also unchecked as is RunTimeException but its not clear to me why they are both lumped together into an unchecked category?
© Stack Overflow or respective owner