A.虛擬的CPU B.CPU執(zhí)行的代碼 C.支持代碼工作的數(shù)據(jù) D.進(jìn)程
現(xiàn)有 class Parser extends Utils { public static void main (String [] args) { try { System.out.print (new Parser () .getlnt ("42")) } catch (Exception e) { System.out.println ("Exc") ; } } int getlnt (String arg) throws Exception { return Integer.parselnt (arg) ; } } class Utils { int getlnt () { return 42; } } 結(jié)果是什么?()
A. 42Exc B. Exc C. 42 D.編譯失敗
現(xiàn)有: 1. class Propeller2 { 2. pulolic static void main (String[]args)//add code here? 3. { new Propeller2().topGo(); } 4. 5.void topGo() //add code here? 6. { middleGo(); } 7. 8.void middleGo() //add code here? 9. { go(); System.out.println ("late middle"); } void go() //add code here? 12. {throw new Exception(); } 13. } 為使代碼通過(guò)編譯,需要在哪一行加入聲明throws Exception?()
A.只在第11行 B.在第8行和第11行 C.在第5行、第8行和第11行 D.在第2行、第5行、第8行和第11行