Runtime exceptions are unchecked and so does that means a method which throws a runtime exception need not be called from within a try catch block or which throws exception type?? Will there be specific questions asking which are checked and unchecked exceptions ?? IF so which exceptions are to be studied ?
Runtime exceptions are unchecked and so does that means a method which throws a runtime exception need not be called from within a try catch block or which throws exception type?? Yes Will there be specific questions asking which are checked and unchecked exceptions ?? In the new 1.4 exam, the objectives concerning exceptions are: - Write code that makes proper use of exceptions and exception handling clauses (try, catch, finally) and declares methods and overriding methods that throw exceptions. - Recognize the effect of an exception arising at a specified point in a code fragment. Note: The exception may be a runtime exception, a checked exception, or an error (the code may include try, catch, or finally clauses in any legitimate combination). IF so which exceptions are to be studied ? You should at least know the most common checked and unchecked exception (ArithmeticException, ClassCastException and the like). Some questions may ask whether some code results in an exception being thrown at runtime (the very effect of unchecked exception) or not. You should be able to recognize that an incorrect cast will result in an exception (ClassCastException) at runtime.
Hi Valentin, I have a question regarding the exception.IT sayd in RHE book, page no:145, that all the sublcass of java.lang.Exception are checked exception except java.lag.RuntimeException . But all under the hierarchy of java.lang.Throwable. What are the ways to recognize which are checked exception and which are not? a) Do i need to memorize them which are under RuntimeException? b)As you stated RuntimeException do not require try and catch , is that can be a criteria? Can you tell me some ways of figuring it out in the code? Thanks for your time Praveen