Given:
and this code fragment:
What is the outcome?
The inner handler catches the ZeroValueException and rethrows that same exception. The outer catch (Exception e) receives it, and concatenating an exception with a string uses its toString() representation. Since the exception has no message, the output is Caught p1.ZeroValueException.
ZeroValueException
catch (Exception e)
toString()
Caught p1.ZeroValueException
Community Discussion