public class
Test {
public static void main(
String[] args) {
byte b = 127;
int i= ~b;
byte b2= ++b;
System.out.println("i= " + i);
System.out.println("b2= " + b2);
System.out.println(i == b2); //true
System.out.println(~b == ++b); //false
}
}
For the above program, I think i== b2 and ~b==++b should both output true, but why it's not? Please help.