First off, if a question were to simply ask "What would be the result?" on a question involving assterions on the exam, do we assume that assertions are enabled or disabled at runtime? Compiled with or not compiled with?
Ex 2: assert (boolean expression) : "houston we have a problem"; -- (in this example the second part can be anything that returns a value, you can send it of to a method as long as the method returns a value, the result will be converted to a string and displayed with the stack trace)
The reason this code will fail to compile is because (val > 0) ? �Ok� : �No good� will not result in a boolean value, it will result in a String. The first part of an assert statement must always result in a boolean value, if you have a second expression as in example 2 that must always result in a value.
The first question is a good one though, from a similar point if they use assert as a variable name in a question are we to assume assertions are enabled?