0

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();

Honza Zidek
  • 8,097
  • 4
  • 63
  • 97
bog
  • 1,273
  • 5
  • 19
  • 34

0 Answers0