[Solved] When I run the code down below it prints “4294967295” and not ‘-1’, Why? [closed]


Your + operator is not designed correctly. In every case, you omit the second argument to the constructor of Integer (whose name is positive), so every integer you make there will have positive set to true, and hence (a1+a2) is always positive (i.e. positive is true).

0

solved When I run the code down below it prints “4294967295” and not ‘-1’, Why? [closed]