高等继续教育 / Java程序设计
正确率:70%
【Java程序设计】模拟试题
读下面程序,给出最后屏幕输出结果。public class ShiftTest{public static void main(String [] args){ int x=0x80000000;int y=0x80000000; x=x>>1; y=y>>>1; System.out.println(“0x80000000>>1 = ” + Integer.toHexString(x)); System.out.println(“0x80000000>>>1 = ” + Integer.toHexString(y));}}
考题内容:
读下面程序,给出最后屏幕输出结果。public class ShiftTest{public static void main(String [] args){ int x=0x80000000; int y=0x80000000; x=x>>1; y=y>>>1; System.out.println(“0x80000000>>1 = ” + Integer.toHexString(x)); System.out.println(“0x80000000>>>1 = ” + Integer.toHexString(y));} }
读下面程序,给出最后屏幕输出结果。public class ShiftTest{public static void main(String [] args){ int x=0x80000000;int y=0x80000000; x=x>>1; y=y>>>1; System.out.println(“0x80000000>>1 = ” + Integer.toHexString(x)); System.out.println(“0x80000000>>>1 = ” + Integer.toHexString(y));}}
考题内容:
读下面程序,给出最后屏幕输出结果。public class ShiftTest{public static void main(String [] args){ int x=0x80000000; int y=0x80000000; x=x>>1; y=y>>>1; System.out.println(“0x80000000>>1 = ” + Integer.toHexString(x)); System.out.println(“0x80000000>>>1 = ” + Integer.toHexString(y));} }
参考答案: