Hii Dinesh.. Exception and Error are subclasses of Throwable... and AssertionError is subclass of Error... In your code, test method throws AssertionError(subclass of Error)..but not handeling that using catch....so, that exception is propagated to the main method...(as main is calling test) now in main method you call test in try block...but you are catching Exception...so it cant't find the matching catch block... so main threads default exception handler prints the message that you see as the output....
SCJP / Preparing For SCWCD
Joined: Aug 06, 2007
So what i need to change to avoid expection. Can you suggest on it