class DemoApp{ public static void main(String[] args){ int x = 5; int y = ++x + x++; S ystem.out.println(“y=”+y+”,x=”+x); } } 以上程序運行后的輸出結(jié)果是哪項?()
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; } } 結(jié)果為:()
A.42 B.NFExc C.42NFExc D.編譯失敗
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; } } 結(jié)果為:()
A.42 B.編譯失敗 C.無輸出結(jié)果 D.運行時異常被拋出