Originally posted by Badal Choudhary: ... Please give your opinions...
In my opinion...
A boolean literal of true is always true by definition.
This question is about the flow of execution when the AssertionError is thrown. To answer this, you need to know where AssertionError fits into the Throwable hierarchy, and the difference between checked vs. unchecked exceptions/errors. Does that help? [ October 12, 2008: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
E is the correct answer. Since you are manually throwing AssertionError, so there is no need to think about whether assertions are enabled or not. The second thing is that if will always be executed. So when test method is executed, an AssertionError will be thrown. So test will not be displayed.
The AssertionError will not be catched by the main method as AssertionError is a sub-class of Error and not Exception. So end will also not be displayed.
Since AssertionError is not an Exception sub-class, so you will say that a Throwable is thrown as both Errors and Exceptions are sub-classes of Throwable..