网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
Given: What is the result?()
A
X, followed by an Exception.
B
No output, and an Exception is thrown.
C
Compilation fails due to an error on line 14.
D
Compilation fails due to an error on line 16.
E
Compilation fails due to an error on line 17.
参考答案
参考解析
解析:
暂无解析
更多 “单选题Given: What is the result?()A X, followed by an Exception.B No output, and an Exception is thrown.C Compilation fails due to an error on line 14.D Compilation fails due to an error on line 16.E Compilation fails due to an error on line 17.” 相关考题
考题
Given:What is the result when method testIfA is invoked?()
A.TrueB.Not trueC.An exception is thrown at runtime.D.Compilation fails because of an error at line 12.E.Compilation fails because of an error at line 19.
考题
10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result?() A、 The code runs with no output.B、 An exception is thrown at runtime.C、 Compilation fails because of an error in line 20.D、 Compilation fails because of an error in line 21.E、 Compilation fails because of an error in line 23.F、 Compilation fails because of an error in line 25.
考题
11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } What is the result?() A、 threeB、 otherC、 An exception is thrown at runtime.D、 Compilation fails because of an error on line 12.E、 Compilation fails because of an error on line 13.F、 Compilation fails because of an error on line 15.
考题
11. public static void main(String[] args) { 12. Object obj = new Object() { 13. public int hashCode() { 14. returns 42; 15. } 16. }; 17. System.out.println(obj.hashCode()); 18. } What is the result? () A、 42B、 An exception is thrown at runtime.C、 Compilation fails because of an error on line 12.D、 Compilation fails because of an error on line 16.E、 Compilation fails because of an error on line 17.
考题
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result?() A、 BB、 The code runs with no output.C、 Compilation fails because of an error in line 12.D、 Compilation fails because of an error in line 15.E、 Compilation fails because of an error in line 18.
考题
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?()A、 Compilation succeeds.B、 Compilation fails because of an error at line 5.C、 Compilation fails because of an error at line 6.D、 Compilation fails because of an error at line 14.E、 Compilation fails because of an error at line 17.
考题
11. static classA { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B “); } 16. } 17. public static void main(String[] args) { 18.A a=new B(); 19. a.process(); 20.} What is the result?() A、 BB、 The code runs with no output.C、 An exception is thrown at runtime.D、 Compilation fails because of an error in line 15.E、 Compilation fails because of an error in line 18.F、 Compilation fails because of an error in line 19.
考题
Given: 11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println("B "); } 16. } 17. public static void main(String[] args) { 18. A a = new B(); 19. a.process(); 20. } What is the result? ()A、 Compilation fails because of an error in line 19.B、 An exception is thrown at runtime.C、 BD、 Compilation fails because of an error in line 18.E、 Compilation fails because of an error in line 15. F、 The code runs with no output.
考题
单选题11. static classA { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B “); } 16. } 17. public static void main(String[] args) { 18.A a=new B(); 19. a.process(); 20.} What is the result?()A
BB
The code runs with no output.C
An exception is thrown at runtime.D
Compilation fails because of an error in line 15.E
Compilation fails because of an error in line 18.F
Compilation fails because of an error in line 19.
考题
单选题Given: What is the result?()A
Compilation succeeds.B
Compilation fails due to multiple errors.C
Compilation fails due to an error only on line 20.D
Compilation fails due to an error only on line 21.E
Compilation fails due to an error only on line 22.
考题
单选题Given: What is the result?()A
testB
nullC
An exception is thrown at runtime.D
Compilation fails because of an error in line 1.E
Compilation fails because of an error in line 4.F
Compilation fails because of an error in line 5.
考题
单选题Given: What is the result?()A
Compilation fails due to an error in line 23.B
Compilation fails due to an error in line 29.C
A ClassCastException occurs in line 29.D
A ClassCastException occurs in line 31.E
The value of all four objects prints in natural order.
考题
单选题Given: What is the result?()A
CanadaB
null CanadaC
Canada nullD
Canada CanadaE
Compilation fails due to an error on line 26.F
Compilation fails due to an error on line 29.
考题
单选题Given: What is the result?()A
BB
B, followed by an Exception.C
Compilation fails due to an error on line 9.D
Compilation fails due to an error on line 14.E
An Exception is thrown with no other output.
考题
单选题11. public static void main(String[] args) { 12. Object obj = new Object() { 13. public int hashCode() { 14. returns 42; 15. } 16. }; 17. System.out.println(obj.hashCode()); 18. } What is the result? ()A
42B
An exception is thrown at runtime.C
Compilation fails because of an error on line 12.D
Compilation fails because of an error on line 16.E
Compilation fails because of an error on line 17.
考题
单选题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?()A
Compilation succeeds.B
Compilation fails because of an error at line 5.C
Compilation fails because of an error at line 6.D
Compilation fails because of an error at line 14.E
Compilation fails because of an error at line 17.
考题
单选题Given: What is the result?()A
CanadaB
null CanadaC
Canada nullD
Canada CanadaE
Compilation fails due to an error on line 26.
考题
单选题11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } What is the result?()A
threeB
otherC
An exception is thrown at runtime.D
Compilation fails because of an error on line 12.E
Compilation fails because of an error on line 13.F
Compilation fails because of an error on line 15.
考题
单选题Given: 11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println("B "); } 16. } 17. public static void main(String[] args) { 18. A a = new B(); 19. a.process(); 20. } What is the result? ()A
Compilation fails because of an error in line 19.B
An exception is thrown at runtime.C
BD
Compilation fails because of an error in line 18.E
Compilation fails because of an error in line 15. F
The code runs with no output.
考题
单选题Given: What is the result?()A
An Exception is thrown with no other outputB
followed by an ExceptionC
Compilation fails due to an error on line 9D
Compilation fails due to an error on line 14
考题
单选题What is the result?()A
Compilation of class A fails.B
Line 28 prints the value 3 to System.out.C
Line 28 prints the value 1 to System.out.D
A runtime error occurs when line 25 executes.E
Compilation fails because of an error on line 28.
考题
单选题11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result?()A
BB
The code runs with no output.C
Compilation fails because of an error in line 12.D
Compilation fails because of an error in line 15.E
Compilation fails because of an error in line 18.
考题
单选题What is the result?()A
Compilation succeeds.B
Compilation fails due to multiple errors.C
Compilation fails due to an error only on line 20.D
Compilation fails due to an error only on line 21.E
Compilation fails due to an error only on line 22.F
Compilation fails due to an error only on line 12.
考题
单选题Given: What is the result when method testIfA is invoked?()A
TrueB
Not trueC
An exception is thrown at runtime.D
Compilation fails because of an error at line 12.E
Compilation fails because of an error at line 19.
考题
单选题10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result?()A
The code runs with no output.B
An exception is thrown at runtime.C
Compilation fails because of an error in line 20.D
Compilation fails because of an error in line 21.E
Compilation fails because of an error in line 23.F
Compilation fails because of an error in line 25.
考题
单选题Given: What is the result?()A
The code runs with no output.B
An exception is thrown at runtime.C
Compilation fails because of an error in line 20.D
Compilation fails because of an error in line 21.E
Compilation fails because of an error in line 23.F
Compilation fails because of an error in line 25.
考题
单选题Given: What is the result?()A
BB
The code runs with no output.C
Compilation fails because of an error in line 12.D
Compilation fails because of an error in line 15.E
Compilation fails because of an error in line 18.
热门标签
最新试卷