单选题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.

题目
单选题
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.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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.


参考答案:A

第2题:

1.public classA{ 2.public String doit(intx,inty){ 3.return"a"; 4.} 5. 6.public String doit(int...vals){ 7.return"b"; 8.} 9.} And: 25.A a=new A(); 26.System.out.println(a.doit(4,5)); 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.

正确答案:A

第3题:

1.public classA{2.public String doit(intx,inty){3.return"a";4.}5.6.public String doit(int...vals){7.return"b";8.}9.}And:25.A a=new A();26.System.out.println(a.doit(4,5));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.


参考答案:A

第4题:

单选题
1. public class A {  2. public String doit(int x, int y) {  3. return “a”;  4. }  5.  6. public String doit(int... vals) {  7. return “b”;  8. } 9. }  Given:  25. A a=new A();  26. System.out.println(a.doit(4, 5));  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.


正确答案: C
解析: 暂无解析

第5题:

1. public class A {  2.  3. private int counter = 0;  4.  5. public static int getInstanceCount() {  6. return counter;  7. }  8.  9. public A() {  10. counter++;  11. }  12.  13. }  Given this code from Class B:  25.A a1 =new A();  26. A a2 =new A();  27. A a3 =new A();  28. System.out.printIn(A.getInstanceCount() ); 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.

正确答案:A

第6题:

class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()  

  • A、 Compilation succeeds and 4 is printed.
  • B、 Compilation succeeds and 43 is printed.
  • C、 An error on line 9 causes compilation to fail.
  • D、 An error on line 14 causes compilation to fail.
  • E、 Compilation succeeds but an exception is thrown at line 9.

正确答案:B

第7题:

public class X {   public static void main (Stringargs) {   int a = new int [1]   modify(a);   System.out.printIn(a[0]);   }   public static void modify (int a) {   a[0] ++;    }    }   What is the result?()  

  • A、 The program runs and prints “0”
  • B、 The program runs and prints “1”
  • C、 The program runs but aborts with an exception.
  • D、 An error “possible undefined variable” at line 4 causes compilation to fail.
  • E、 An error “possible undefined variable” at line 9 causes compilation to fail.

正确答案:B

第8题:

Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()

A.Compilation will succeed for all classes and interfaces.

B.Compilation of class C will fail because of an error in line 2.

C.Compilation of class C will fail because of an error in line 6.

D.Compilation of class AImpl will fail because of an error in line 2


参考答案:C

第9题:

1. public class A {  2. public String doit(int x, int y) {  3. return “a”;  4. }  5.  6. public String doit(int... vals) {  7. return “b”;  8. } 9. }  Given:  25. A a=new A();  26. System.out.println(a.doit(4, 5));  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.

正确答案:A

第10题:

单选题
Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()
A

Compilation will succeed for all classes and interfaces.

B

Compilation of class C will fail because of an error in line 2.

C

Compilation of class C will fail because of an error in line 6.

D

Compilation of class AImpl will fail because of an error in line 2.


正确答案: B
解析: 暂无解析

更多相关问题