About Question enthuware.ocpjp.v8.2.1381 :
Posted: Wed Aug 31, 2016 3:34 pm
In the answers, for bullet 3
"A exception thrown by a failed assertion cannot be caught using a try/catch block."
But in the explanation, you correctly state "A failed assertion throws java.lang.AssertionError, which can be caught by a catch block."
Would it be a better reading of bullet 3 to be
"A exception thrown by a failed assertion cannot be caught using this try/catch block."
You are still drawing out the idea that it is AssertionError that is not derived from Exception, but retains the idea that you can (not recommended) catch them.
"A exception thrown by a failed assertion cannot be caught using a try/catch block."
But in the explanation, you correctly state "A failed assertion throws java.lang.AssertionError, which can be caught by a catch block."
Would it be a better reading of bullet 3 to be
"A exception thrown by a failed assertion cannot be caught using this try/catch block."
You are still drawing out the idea that it is AssertionError that is not derived from Exception, but retains the idea that you can (not recommended) catch them.