31. // some code here  32. try {  33. // some code here  34.

题目
多选题
31. // some code here  32. try {  33. // some code here  34. } catch (SomeException se) {  35. // some code here  36. } finally {  37. // some code here  38. }  Under which three circumstances will the code on line 37 be executed?()
A

The instance gets garbage collected.

B

The code on line 33 throws an exception.

C

The code on line 35 throws an exception.

D

The code on line 31 throws an exception.

E

The code on line 33 executes successfully.

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

第1题:

Given:Which method will complete this class?()

A.public int compareTo(Object o){/*more code here*/}

B.public int compareTo(Score other){/*more code here*/}

C.public int compare(Score s1,Score s2){/*more code here*/}

D.public int compare(Object o1,Object o2){/*more code here*/}


参考答案:B

第2题:

Here are some _______(信) for you,Jane!


正确答案:
32. letters

第3题:

Do you have ______ shrimps? ---Here they ______ .

A、any,are

B、some,is

C、any,be

D、some,are


参考答案: A

第4题:

31. // some code here  32. try {  33. // some code here  34. } catch (SomeException se) {  35. // some code here  36. } finally {  37. // some code here  38. }  Under which three circumstances will the code on line 37 be executed?()

  • A、 The instance gets garbage collected.
  • B、 The code on line 33 throws an exception.
  • C、 The code on line 35 throws an exception.
  • D、 The code on line 31 throws an exception.
  • E、 The code on line 33 executes successfully.

正确答案:B,C,E

第5题:

class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()

  • A、 int foo() { /* more code here */ }
  • B、 void foo() { /* more code here */ }
  • C、 public void foo() { /* more code here */ }
  • D、 private void foo() { /* more code here */ }
  • E、 protected void foo() { /* more code here */ }

正确答案:B,C,E

第6题:

Here are some drawings () for the new apartment.

A、to design

B、designing

C、designed

D、design


参考答案:C

第7题:

1. public class a {  2. public void method1() {  3. try {  4. B b=new b();  5. b.method2();  6. // more code here  7. } catch (TestException te) {  8. throw new RuntimeException(te);  9. }  10. }  11. }  1. public class b {  2. public void method2() throws TestException {  3. // more code here  4. }  5. }  1. public class TestException extends Exception {  2. }  Given:  31. public void method() {  32. A a=new a();  33. a.method1();  34. }  Which is true if a TestException is thrown on line 3 of class b?()

  • A、 Line 33 must be called within a try block.
  • B、 The exception thrown by method1 in class a is not required to be caught.
  • C、 The method declared on line 31 must be declared to throw a RuntimeException.
  • D、 On line 5 of class a, the call to method2 of class b does not need to be placed in a try/catch block.

正确答案:B

第8题:

Here are a few apples. Would you like to have _____________?

A、ones

B、some ones

C、one


参考答案:C

第9题:

33. try {  34. // some code here  35. } catch (NullPointerException e1) {  36. System.out.print(”a”);  37. } catch (RuntimeException e2) {  38. System.out.print(”b”);  39. } finally {  40. System.out.print(”c”);  41. }  What is the result if a NullPointerException occurs on line 34?() 

  • A、 c
  • B、 a
  • C、 ab
  • D、 ac
  • E、 bc
  • F、 abc

正确答案:D

第10题:

public class Team extends java.util.LinkedList {  public void addPlayer(Player p) {  add(p);  }  public void compete(Team opponent) { /* more code here */ }  }  class Player { /* more code here */ }  Which two are true?()

  • A、 This code will compile.
  • B、 This code demonstrates proper design of an is-a relationship.
  • C、 This code demonstrates proper design of a has-a relationship.
  • D、 A Java programmer using the Team class could remove Player objects from a Team object.

正确答案:A,D

更多相关问题