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
  • 9,204
  • 4
  • 72
  • 118
bog
  • 1,323
  • 5
  • 22
  • 34

0 Answers0