interface Altitude { //insert code here } 和4個(gè)聲明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分別插入到第2行,有多少行可以編譯?()
A. 0 B. 1 C. 2 D. 3 E. 4
現(xiàn)有: 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. 運(yùn)行時(shí)異常被拋出。
下述代碼執(zhí)行后,有幾個(gè)引用變量和幾個(gè)對(duì)象?() 對(duì)象聲明Student stu(對(duì)象)= new Student(“Mike”); 對(duì)象定義(開辟空間) Student stua;(聲明變量) Stua = stu;
A. 2個(gè)引用變量,1個(gè)對(duì)象 B. 1個(gè)引用變量,1個(gè)對(duì)象 C. 2個(gè)引用變量,2個(gè)對(duì)象 D. 1個(gè)引用變量,2個(gè)對(duì)象