单选题Given: What is the result?()A testB ExceptionC Compilation fails.D NullPointerException

题目
单选题
Given: What is the result?()
A

test

B

Exception

C

Compilation fails.

D

NullPointerException

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

第1题:

try {  int x = 0;  int y = 5 / x;  } catch (Exception e) {  System.out.println(“Exception”);  } catch (ArithmeticException ae) {  System.out.println(“Arithmetic Exception”);  }  System.out.println(“finished”);  What is the result?()  

  • A、 finished
  • B、 Exception
  • C、 Compilation fails.
  • D、 Arithmetic Exception

正确答案:D

第2题:

public class Test {  private static int[] x;  public static void main(String[] args) {  System.out.println(x[0]);  }  }   What is the result?()   

  • A、 0
  • B、 null
  • C、 Compilation fails.
  • D、 A NullPointerException is thrown at runtime.
  • E、 An ArrayIndexOutOfBoundsException is thrown at runtime.

正确答案:D

第3题:

publicstaticvoidmain(String[]args){try{args=null;args[0]=test”;System.out.println(args[0]);}catch(Exceptionex){System.out.println(”Exception”);}catch(NullPointerExceptionnpe){System.out.println(”NullPointerException”);}}Whatistheresult?()

A.test

B.Exception

C.Compilationfails.

D.NullPointerException


参考答案:C

第4题:

单选题
Given: What is the result?()
A

test

B

Exception

C

Compilation fails.

D

NullPointerException


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

第5题:

单选题
public class Test {  private static int[] x;  public static void main(String[] args) {  System.out.println(x[0]);  }  }   What is the result?()
A

 0

B

 null

C

 Compilation fails.

D

 A NullPointerException is thrown at runtime.

E

 An ArrayIndexOutOfBoundsException is thrown at runtime.


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

第6题:

public static void main(String[] args) {  try {  args=null;  args[0] = “test”;  System.out.println(args[0]);  } catch (Exception ex) {  System.out.println(”Exception”);  } catch (NullPointerException npe) {  System.out.println(”NullPointerException”);  }  }  What is the result?() 

  • A、 test
  • B、 Exception
  • C、 Compilation fails.
  • D、 NullPointerException

正确答案:C

第7题:

单选题
Given: What is the result?()
A

collie

B

harrier

C

Compilation fails.

D

collie harrier

E

An exception is thrown at runtime.


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

第8题:

class TestA {  public void start() { System.out.println(”TestA”); }  }  public class TestB extends TestA {  public void start() { System.out.println(”TestB”); } public static void main(String[] args) {  ((TestA)new TestB()).start();  }  }  What is the result?() 

  • A、 TestA
  • B、 TestB
  • C、 Compilation fails.
  • D、 An exception is thrown at runtime.

正确答案:B

第9题:

单选题
Given: What is the result?()
A

r, t, t,

B

r, e, o,

C

Compilation fails.

D

An exception is thrown at runtime.


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

第10题:

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


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

更多相关问题