网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?()
A
The code runs with no output.
B
Compilation fails.
C
An exception is thrown at runtime.
D
ClassC is displayed.
参考答案
参考解析
解析:
暂无解析
更多 “单选题Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result?()A The code runs with no output.B Compilation fails.C An exception is thrown at runtime.D ClassC is displayed.” 相关考题
考题
Click the Exhibit button. What is the result? ()
A.Value is: 8B.Compilation fails.C.Value is: 12D.Value is: -12E.The code runs with no output.F.An exception is thrown at runtime.
考题
Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result? ()
A.Compilation fails.B.ClassC is displayed.C.The code runs with no output.D.An exception is thrown at runtime.
考题
Click the Exhibit button.Given:What is the result?()
A.Line 26 prints a to System.out.B.Line 26 prints b to System.out.C.An exception is thrown at line 26 at runtime.D.Compilation of class A will fail due to an error in line 6.
考题
Click the Exhibit button. What is the output if the main() method is run?()
A.4B.5C.8D.9E.Compilation fails.F.An exception is thrown at runtime.G.It is impossible to determine for certain.
考题
Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()A、p0 = p1;B、p1 = p2;C、p2 = p4;D、p2 = (ClassC)p1;E、p1 = (ClassB)p3;F、p2 = (ClassC)p4;
考题
public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( “Finally” ); } } } What is the result?()A、 FinallyB、 Compilation fails.C、 The code runs with no output.D、 An exception is thrown at runtime.
考题
10. public class ClassA { 11. public void methodA() { 12. ClassB classB = new ClassB(); 13. classB.getValue(); 14. } 15. } And: 20. class ClassB { 21. public ClassC classC; 22. 23. public String getValue() { 24. return classC.getValue(); 25. } 26. } And: 30. class ClassC { 31. public String value; 32. 33. public String getValue() { 34. value = “ClassB”; 35. return value; 36. } 37. } Given: ClassA a = new ClassA(); a.methodA(); What is the result?()A、 Compilation fails.B、 ClassC is displayed.C、 The code runs with no output.D、 An exception is thrown at runtime.
考题
interface Beta {} class Alpha implements Beta { String testIt() { return “Tested”; } } public class Main1 { static Beta getIt() { return new Alpha(); } public static void main( String[] args ) { Beta b = getIt(); System.out.println( b.testIt() ); } } What is the result?() A、 TestedB、 Compilation fails.C、 The code runs with no output.D、 An exception is thrown at runtime.
考题
public class ClassA { public int getValue() { int value=0; boolean setting = true; String title=”Hello”; (value || (setting title == “Hello”)) { return 1; } (value == 1 title.equals(”Hello”)) { return 2; } } } And: ClassA a = new ClassA(); a.getValue(); What is the result?() A、 1B、 2C、 Compilation fails.D、 The code runs with no output.E、 An exception is thrown at runtime.
考题
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.
考题
单选题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 fails.B
An exception is thrown at runtime.C
The code executes normally and prints "sleep".D
The code executes normally, but nothing is printed.
考题
单选题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.
考题
单选题Click the Exhibit button. What is the result?()A
The code will deadlock.B
The code may run with output "2 0 6 4".C
The code may run with no output.D
The code may run with output "0 6".E
An exception is thrown at runtime.F
The code may run with output "0 2 4 6".
考题
单选题Click the Exhibit button. Given: ClassA a = new ClassA( ); a.methodA( ); What is the result? ()A
Compilation fails.B
ClassC is displayed.C
The code runs with no output.D
An exception is thrown at runtime.
考题
单选题Given: What is the result?()A
Compilation fails.B
An exception is thrown at runtime.C
The code executes and prints "running".D
The code executes and prints "runningrunning".E
The code executes and prints "runningrunningrunning".
考题
单选题Click the Exhibit button. What is the result?()A
Line 26 prints "a" to System.out.B
Line 26 prints "b" to System.out.C
An exception is thrown at line 26 at runtime.D
Compilation of class A will fail due to an error in line 6.
考题
多选题Given: class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()Ap0 = p1;Bp1 = p2;Cp2 = p4;Dp2 = (ClassC)p1;Ep1 = (ClassB)p3;Fp2 = (ClassC)p4;
考题
单选题public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( “Finally” ); } } } What is the result?()A
FinallyB
Compilation fails.C
The code runs with no output.D
An exception is thrown at runtime.
考题
单选题10. public class ClassA { 11. public void methodA() { 12. ClassB classB = new ClassB(); 13. classB.getValue(); 14. } 15. } And: 20. class ClassB { 21. public ClassC classC; 22. 23. public String getValue() { 24. return classC.getValue(); 25. } 26. } And: 30. class ClassC { 31. public String value; 32. 33. public String getValue() { 34. value = “ClassB”; 35. return value; 36. } 37. } Given: ClassA a = new ClassA(); a.methodA(); What is the result?()A
Compilation fails.B
ClassC is displayed.C
The code runs with no output.D
An exception is thrown at runtime.
考题
单选题Click the Exhibit button. What is the result?()A
Value is: 8B
Compilation fails.C
Value is: 12D
Value is: -12
考题
单选题Given: What is the result?()A
test endB
Compilation fails.C
test runtime endD
test exception endE
A Throwable is thrown by main at runtime.
考题
单选题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.
考题
单选题public class ClassA{ public int getValue(){ int value=0; boolean setting=true; String title="Hello"; if(value||(setting title=="Hello")){return 1;} if(value==1title.equals("Hello")){return 2;} } } And: ClassA a=new ClassA(); a.getValue(); What is the result?()A
1B
2C
Compilation fails.D
The code runs with no output.E
An exception is thrown at runtime.
考题
单选题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.
考题
单选题public class ClassA { public int getValue() { int value=0; boolean setting = true; String title=”Hello”; (value || (setting title == “Hello”)) { return 1; } (value == 1 title.equals(”Hello”)) { return 2; } } } And: ClassA a = new ClassA(); a.getValue(); What is the result?()A
1B
2C
Compilation fails.D
The code runs with no output.E
An exception is thrown at runtime.
考题
单选题Given: What is the result?()A
HelloB
Hello WorldC
Compilation fails.D
Hello World 5E
The code runs with no output.F
An exception is thrown at runtime.
热门标签
最新试卷