Can I say JVM exceptions are unchecked exceptions and Programmatic exceptions are checked exceptions? Because it seems like JVM exceptions are thrown at runtime so could not be checked…
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There may be two separate distinctions involved in what you are asking. Exception thrown by the JVM runtime extend from
Errorwhereas programmatic exceptions extend fromException. Unchecked programmatic exceptions extend fromRuntimeException. So there are two distinct class hierarchies for unchecked exceptions. Do note that the JVM/programmatic distinction is convention only: you can indeed throw any exception class you want from Java code.Also make sure to distinguish JVM exceptions from JDK exceptions—those thrown by the standard Java library. No JVM exception is checked, but a lot of JDK exceptions are.
As for the checked/unchecked distinction, the compiler forces you to declare in advance all checked exceptions your method may throw either explicitly or by calling a method that may throw them. No such checking is done for unchecked exceptions.