多选题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?()AThe instance gets garbage collected.BThe code on line 33 throws an exception.CThe code on line 35 throws an exception.DThe code on line 31 throws an exception.EThe code on line 33 executes successfully.

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


参考解析

解析: 暂无解析

相关考题:

Do you have ______ shrimps? ---Here they ______ .A、any,areB、some,isC、any,beD、some,are

Here are a few apples. Would you like to have _____________?A、onesB、some onesC、one

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*/}

Here are some drawings () for the new apartment. A、to designB、designingC、designedD、design

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

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.

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 */ }

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、 cB、 aC、 abD、 acE、 bcF、 abc

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.

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.

34. HashMap props = new HashMap();  35. props.put(”key45”, “some value”);  36. props.put(”key12”, “some other value”);  37. props.put(”key39”, “yet another value”);  38. Set s = props.keySet();  39. // insert code here  What, inserted at line 39, will sort the keys in the props HashMap?() A、 Arrays.sort(s);B、 s = new TreeSet(s);C、 Collections.sort(s);D、 s = new SortedSet(s);

Which three will compile and run without exception?()A、private synchronized Object o;B、void go() {synchronized() { /* code here */ }C、public synchronized void go() { /* code here */ }D、private synchronized(this) void go() { /* code here */ }E、void go() {synchronized(Object.class) { /* code here */ }F、void go() {Object o = new Object();synchronized(o) { /* code here */ }

多选题Given:   10. class One {   11. void foo() { }   12. }   13. class Two extends One {   14. //insert method here   15. }   Which three methods, inserted individually at line 14, will correctly complete class Two?()Apublic void foo() { /* more code here */ }Bprivate void foo() { /* more code here */ }Cprotected void foo() { /* more code here */ }Dint foo() { /* more code here */ }Evoid foo() { /* more code here */ }

多选题class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }

多选题Given: Which three methods, inserted individually at line 14, will correctly complete class Two?()Aint foo() { /* more code here */ }Bvoid foo() { /* more code here */ }Cpublic void foo() { /* more code here */ }Dprivate void foo() { /* more code here */ }Eprotected void foo() { /* more code here */ }

单选题33. Date d = new Date(0);  34. String ds = “December 15, 2004”;  35. // insert code here  36. try {  37. d = df.parse(ds);  38. }  39. catch(ParseException e) {  40. System.out.println(”Unable to parse “+ ds);  41. }  42. // insert code here too  Which will create the appropriate DateFormat object and add a day to the Date object?()A 35. DateFormat df= DateFormat.getDateFormat(); 42. d.setTime( (60 * 60 * 24) +d.getTime());B 35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setTime( (1000 * 60 * 60 * 24) + d.getTime());C 35. DateFormat df= DateFormat.getDateFormat(); 42. d.setLocalTime( (1000*60*60*24) + d.getLocalTime());D 35. DateFormat df= DateFormat.getDateJnstance(); 42. d.setLocalTime( (60 * 60 * 24) + d.getLocalTime());

多选题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?()AThis code will compile.BThis code demonstrates proper design of an is-a relationship.CThis code demonstrates proper design of a has-a relationship.DA Java programmer using the Team class could remove Player objects from a Team object.

单选题ABCDEFGHIJKLMNOPQRSTUVWXYZ  The alphabet is here to help you with these questions.  You need to work out a different code for each question.Example  If the code for FOOT is ENNS, what is the code for TOE?Answer SND  If the code for ORANGE is RUDQJH, what does SLQN mean?AOHMJBPINKCQJOLDPOKE

单选题Here is some _____ advice to any young businessman.AvariableBworthwhileCworthyDvalue

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

多选题Which three will compile and run without exception?()Aprivate synchronized Object o;Bvoid go(){   synchronized(){/* code here */}Cpublic synchronized void go(){/* code here */}Dprivate synchronized(this) void go(){/* code here */}Evoid go(){   synchronized(Object.class){/* code here */}Fvoid go(){   Object o = new Object();   synchronized(o){/* code here */}

单选题public class Score implements Comparable {  private int wins, losses;  public Score(int w, int 1) { wins = w; losses = 1; }  public int getWins() { return wins; }  public int getLosses() { return losses; }  public String toString() {  return “”; }  // insert code here  }  Which method will complete this class?()A public int compareTo(Object o) {/*mode 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*/}

问答题ABCDEFGHIJKLMNOPQRSTUVWXYZ  The alphabet is here to help you with these questions.You need to work out a different code for each question.Choose the correct answer.ExampleIf the code for FOOT is ENNS,what is the code for TOE? Answer:SND.If the code for ORANGE is RUDQJH, what does SLQN mean?A.OHMJB.PINKC.QJOLD.POKE

多选题1. public class A {  2. public void method1() {  3. B b=new B();  4. b.method2();  5. // more code here  6. }  7. }  1. public class B {  2. public void method2() {  3.C c=new C();  4. c.method3();  5. // more code here  6. }  7. }  1. public class C {  2. public void method3() {  3. // more code here  4. }  5. }  Given:  25. try {  26. A a=new A();  27. a.method1();  28. } catch (Exception e) {  29. System.out.print(”an error occurred”);  30. }  Which two are true if a NullPointerException is thrown on line 3 of class C?()AThe application will crash.BThe code on line 29 will be executed.CThe code on line 5 of class A will execute.DThe code on line 5 of class B will execute.EThe exception will be propagated back to line 27.

多选题10. class Foo {  11. static void alpha() { /* more code here */ }  12. void beta() { /* more code here */ }  13. }  Which two are true?()AFoo.beta() is a valid invocation of beta().BFoo.alpha() is a valid invocation of alpha().CMethod beta() can directly call method alpha().DMethod alpha() can directly call method beta().

单选题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 cB aC abD acE bcF abc

单选题34. HashMap props = new HashMap();  35. props.put(”key45”, “some value”);  36. props.put(”key12”, “some other value”);  37. props.put(”key39”, “yet another value”);  38. Set s = props.keySet();  39. // insert code here  What, inserted at line 39, will sort the keys in the props HashMap?()A Arrays.sort(s);B s = new TreeSet(s);C Collections.sort(s);D s = new SortedSet(s);