下述代碼執(zhí)行后,有幾個引用變量和幾個對象?() 對象聲明Student stu(對象)= new Student(“Mike”); 對象定義(開辟空間) Student stua;(聲明變量) Stua = stu;
A. 2個引用變量,1個對象 B. 1個引用變量,1個對象 C. 2個引用變量,2個對象 D. 1個引用變量,2個對象
public class TestA{ public void methodA() throws IOException{ //…… } } public class TestB extends TestA{ public void methodA() throws EOFException{ //…… } } public class TestC extends TestA{ public void methodA() throws Exception{ //…… } } 當編譯類TestC的時候,結果是哪項?()
A. 正常 B. 編譯錯誤 C. 運行錯誤 D. 以上都不對
public class TestApp{ public int mymethod(){ try{ int i = 0; int j = 1 / i; System.out.println(“1”); }finally{ System.out.print(“4”); } return 1; } } 上述程序運行后的輸出是哪項?()
A. 4 B. 14 C. 41 D. 以上都不對