This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i know that error can't be handle by exception handler. but what i understand from output that the assertionerror is an exception
that means that it is may be a child for excepton class so why catch clause fails to handle.
and also ....at the same time i wondered why it cause an excption not an error
Saying specifically it will be an Error not throwable. But because throwable is parent of both Error and Exception so in case of both you can say that if is a throwable but actually it will be Error or Exception.
Error and RuntimeException are unchecked exceptions so the compiler doesn't care whether you catch them, declare them or ignore them. Changing line 15 on your code to say (Error e) will bear out what Wouter has said.