Originally posted by hamraj happy:
Please give the explanation why the output is not coming as "ab" in this code??
Instead the code is running without any output.
Where are you printing in your code so that your expected output gets displayed?
Moreover, you are throwing an exception and again rethrowing it in the catch block. All what you have in the final block is a single return statement which does nothing but returns the control back to the place of calling.
Try having some
meaningful System.out.println() statements in each block. You will get to know.