I do not understand why the output of this code is -10
:
public class Prova {
public void sip(int i){
assert i>=0 : err();
System.out.println(i);
}
public int err(){
...
}
public static void main(String[] args) {
Prova t = new Prova();
t.sip(-10);
}
}
I thought assert would launch err();