Vince Botteman wrote:In the answer option D (LimpException) is said to be incorrect because the method split throws HurtException and no other exception. Therefore catching LimpException would be unreachable code because HurtException is already caugth.
But I can compile following code, so answer D is correct. I do receive a warning in my IDE about unreachable code but the source compiles and runs.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:Roel: That's evil!
Vince Botteman wrote:It takes my knowledge of exceptions one step further.
Roel De Nijs wrote:Given this class hierarchy
...
which of these methods will not compile and/or not run successfully? And why not?
...
Mushfiq Mammadov wrote:It is interesting that why don't you write study guide about certification?
This time it fails to compile because the catch block is unreachable.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|