/** * Created by xabcd on 2019/2/11. */ public class TestJava3_14 {public static void main(String args[]) { byte a = java.lang.Byte.MAX_VALUE; boolean b = false; System.out.println("a = "+a+",~a="+(~a)); System.out.println("b = "+b+",!b = "+(!b)); } } 结果: a = 127,~a=-128 b = false,!b = true ~取补码