Hey Ranchers, this is from the Whizlab simulator and doesn't add up. Probably something small I'm overseeing, but I don't get it:
Here's the code, pardon the layout, I know it isn't supposed to be like this:
public class AssertTest {
private Boolean isValid(int i) {
if(i<1 || i > 12 ) {
return new Boolean("false return"); // OK
}
else {
return new Boolean(true);
}
}
private void testValue( int val ) {
assert isValid(val) : "out of range value";
}
public static void main(
String[] args) {
AssertTest
test = new AssertTest();
test.testValue(22); // When I compile, no AssertionError is thrown???
}
}
How come there's no Assertion Error?
Thanks.