現(xiàn)有: 1. interface Altitude { 2. //insert code here 3. } 和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. 無(wú)輸出結(jié)果。 D. 運(yùn)行時(shí)異常被拋出。
類Student代碼如下: class Student{ String name; int age; Student(String nm){ name = nm; } } 執(zhí)行語(yǔ)句Student stu = new Student()后,字段age的值是哪項(xiàng)?()
A. 0 B. null C. false D. 編譯錯(cuò)誤