单项选择题
class MyApp{
public static void main(String[] args){ int age;
System.out.println(“age=”+age); } }
执行上述代码后输出的结果是哪项?()
A.age=0
B.age=null
C.age=
D.程序编译错误
点击查看答案&解析
相关考题
-
单项选择题
class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x.equals(42)) { System.out.print("dot = "); } else { System.out.print("done"); } } } 结果为:()
A.42
B.done
C.dot =
D.编译失败 -
单项选择题
class Account { private int balance; public void setBalance(int b) { balance = b; } public int getBalance() { return balance; } public void clearBalance() { balance = 0; } } 哪一个改变可以使 Account 类线程安全?()
A.在第2行加 synchronized 修饰符。
B.在第3行加 synchronized 修饰符。
C.在第3行、第4行和第6行加 synchronized 修饰符。
D.在第4行、第6行和第8行加 synchronized 修饰符。 -
单项选择题
使GUI事件处理器生效的方法是:()
A.将事件源向事件处理器注册
B.将事件处理器向事件源注册
C.将事件处理器向事件注册
D.将事件向事件处理器注册
