public class WY {
public static void main(String args []){
int i = 1<<31;
int j = 1<<32;
int p = 1<<33;
System.out.println("1左移31位"+i);
System.out.println("1左移32位"+j);
System.out.println("1左移33位"+p);
}
}输出:1左移31位-2147483648
1左移32位1
1左移33位2
public static void main(String args []){
int i = 1<<31;
int j = 1<<32;
int p = 1<<33;
System.out.println("1左移31位"+i);
System.out.println("1左移32位"+j);
System.out.println("1左移33位"+p);
}
}输出:1左移31位-2147483648
1左移32位1
1左移33位2
int型变量为32位(w),左移量为k,实际位移为 k mod w的结果 = 33 % 32 = 1
1左移1位为2