This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I'm not sure, but I think you're asking about the optional expression in an assertion. That is, the difference between...
assert boolean: expression;
If an expression is included, then it is passed to the constructor of the AssertionError, where it's converted to a String message. Basically, it allows you to pass some additional information to the Error.
"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
Joined: Feb 10, 2007
actually above 2 are examples from whizlabs mock exams.why assertion in the first program valid and not in the second one?i thought it is invalid to use assertions to check arguments in public method.but not able to find out why then is the second condition valid?