class Demo3_Operator {
public static void main(String[] args) {
System.out.println("左移21 = " + (-12 << 21));
System.out.println("左移22 = " + (-12 << 22));
System.out.println("左移23 = " + (-12 << 23));
System.out.println("左移24 = " + (-12 << 24));
System.out.println("左移25 = " + (-12 << 25));
System.out.println("左移26 = " + (-12 << 26));
System.out.println("左移27 = " + (-12 << 27));
System.out.println("左移28 = " + (-12 << 28));
System.out.println("左移29 = " + (-12 << 29));
System.out.println("左移30 = " + (-12 << 30));
System.out.println("左移31 = " + (-12 << 31));
System.out.println("左移32 = " + (-12 << 32));
System.out.println("左移33 = " + (-12 << 33));
System.out.println("左移34 = " + (-12 << 34));
System.out.println("左移35 = " + (-12 << 35));
}
}
27的结果是-1610612736
28的结果是1073741824
29的结果是-2147483648
30的结果是0
31的结果是0
32的结果是-12
33的结果是-24
|
|