Canada
null Canada
Canada null
Canada Canada
Compilation fails due to an error on line 26.
单选题Given: What is the result?()ACompilation fails due to an error in line 23.BCompilation fails due to an error in line 29.CA ClassCastException occurs in line 29.DA ClassCastException occurs in line 31.EThe value of all four objects prints in natural order.
点击查看答案
单选题Given: What is the result?()ACanadaBnull CanadaCCanada nullDCanada CanadaECompilation fails due to an error on line 26.FCompilation fails due to an error on line 29.
单选题Given: What is the result?()ABBB, followed by an Exception.CCompilation fails due to an error on line 9.DCompilation fails due to an error on line 14.EAn Exception is thrown with no other output.
单选题Click the Exhibit button. Given this code from Class B: 25.A a1 = new A(); 26.A a2 = new A(); 27.A a3 = new A(); 28.System.out.println(A.getInstanceCount()); What is the result?()ACompilation of class A fails.BLine 28 prints the value 3 to System.out.CLine 28 prints the value 1 to System.out.DA runtime error occurs when line 25 executes.ECompilation fails because of an error on line 28.
单选题Click the Exhibit button. Given this code from Class B: 25. A a1 = new A(); 26. A a2 = new A(); 27. A a3 = new A(); 28. System.out.println(A.getInstanceCount()); What is the result?()ACompilation of class A fails.BLine 28 prints the value 3 to System.out.CLine 28 prints the value 1 to System.out.DCompilation fails because of an error on line 28.EA runtime error occurs when line 25 executes.
单选题Given: What is the result?()AIf you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.BIf you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 5.CCompilation fails because of an error in line 9.DIf you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.ECompilation fails because of an error in line 3.FCompilation fails because of an error in line 7.
单选题package foo; import java.util.Vector; private class MyVector extends Vector { int i = 1; public MyVector() { i = 2; } } public class MyNewVector extends MyVector { public MyNewVector() { i = 4; } public static void main(String args[]) { MyVector v = new MyNewVector(); } } What is the result?()ACompilation succeeds.BCompilation fails because of an error at line 5.CCompilation fails because of an error at line 6.DCompilation fails because of an error at line 14.ECompilation fails because of an error at line 17.