The answer in K&B is hello throwit caught finally after
My doubt is how come "after" is printed, when an exception occurs doesn't the code exits the VM after the finally or is it if the exception is caught it executes the code to the bottom of the method stack call.
Thanks in advance Jigo
posted 11 years ago
That's why we use a caught. To keep the code running.. It doesn't make sense stop after caught the exception.
I don't know if it's right.. correct me if I'm wrong.
That's right. If the exception is caught, program will follow instructions in exception block. If there is no catch exception block, the exception will be thrown back to JVM and program will be aborted with error messages.
SCEA, SCBCD, SCJP
Whatever. Here's a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads