给出下列程序,正确的输出是?class A {public static void main(String[] a) {int x = 5, y = 6;x += y--;y &= x;System.out.println("x="+ x + "\ty="+ y);}}
答:A. x=11 y=1
继续答题:下一题


更多JAVA程序设计试题
- 1下列哪个叙述是正确的?
- 2当使用SomeThread t=new SomeThread()创建一个线程时,下列叙述中正确的是
- 3while语句的循环体中不能包含的语句是
- 4下列关于使用this调用构造方法的说法中,错误的是?
- 5阅读下列代码public class Example {public static void main(String[] args) {int[] srcArray = { 11, 12, 13, 14 };int[] destArray = { 21, 22, 23, 24 };System.arraycopy(srcArray, 1, destArray, 2, 2);for (int i = 0; i < destArray.length; i++) {System.out.print(destArray[i] + " ");}}}下列选项中,程序的运行结果是?
- 6给定如下Java代码,编译运行的结果是()。public class Test {public static void main(String[] args) {Map map = new HashMap();String s = "code";map.put(s, "1");map.put(s, "2");System.out.println(map.size());}}