Both Error and Exception classes are siblings in the inheritance tree. Both are Throwable's childs. So, as AssertionError is a subclass of Error, the expected result can never be "Exception caught".
Think about that : If AssertionError were a subclass of Exception, just a supposition, you would get a compile error because the most specific class have to appear first in the catch clause followed by its superclasses.
Please let me know if I can do anything else to help you with.
Best Regards. [ April 20, 2006: Message edited by: Edisandro Bessa ]
"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself
The simple reason why it is not getting caught is that, Exception not superclass of AssertionError, if it were ,then your code might have not executed because compiler might have objected that catch(AssertionError e) is unreachable, as it was not happened ,you got the evidence, i think
what do you say.
Joined: Apr 19, 2006
Hey thanks Edisandro and kiran.
I checked Exception hierarchy chart you ppl are right.
Exception and Error are siblings of Throwable class and Assertion is subclass of Error.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com