About Question enthuware.ocpjp.v7.2.1598 :
Posted: Sun Jan 31, 2016 7:01 pm
Paul - I got this question incorrect and I fully understand why. I just wanted to make a suggestion in regards to the wording of one of the answers.
Answer choice 5 "It will compile but will not throw any exception even if the value is not equal to 10". While this answer choice is not the correct answer choice, technically there is nothing wrong with it. It is true that it will compile and it is true that no Exception will be thrown. An AssertionError will be thrown which is an Error and an Error is a Throwable and not an Exception. Perhaps the language for this answer could be better if it was "...will not throw any exception or error..."
Answer choice 5 "It will compile but will not throw any exception even if the value is not equal to 10". While this answer choice is not the correct answer choice, technically there is nothing wrong with it. It is true that it will compile and it is true that no Exception will be thrown. An AssertionError will be thrown which is an Error and an Error is a Throwable and not an Exception. Perhaps the language for this answer could be better if it was "...will not throw any exception or error..."