black

Java认证考试综合练习

登录

单项选择题

class DemoApp{ 
public static void main(String[] args){ 
int x = 5; int y = ++x + x++; S
ystem.out.println(“y=”+y+”,x=”+x); 
} 
} 
以上程序运行后的输出结果是哪项?() 

A.y=10,x=5
B.y=11,x=6
C.y=12,x=7
D.y=11,x=7

相关考题

单项选择题 class Parser extends Utils {  public static void main (String [] args) {  try { System.out.print(new Parser().getInt("42"));  } catch (NumberFormatException n) {  System.out.println("NFExc "); }  }  int getInt(String arg) throws NumberFormatException {  return Integer.parseInt(arg);  }  }  class Utils {  int getInt(String arg) { return 42; }  }  结果为:()

单项选择题 class Parser extends Utils {  public static void main(String [] args) {   System.out.print(new Parser().getInt("42"));  }  int getInt(String arg) {  return Integer.parseInt(arg);  }  }  class Utils {  int getInt(String arg) throws Exception { return 42; }  }  结果为:()

单项选择题 class Top {  static int x = 1;  public Top(int y) { x *= 3; }  }  class Middle extends Top {  public Middle() { x += 1; }  public static void main(String [] args) {  Middle m = new Middle();  System.out.println(x);  }  }  结果为:()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064