网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
Which three will compile and rim 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 */ } }


参考答案

参考解析
解析: 暂无解析
更多 “多选题Which three will compile and rim 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 */ } }” 相关考题
考题 three of the following universities have large endowments from wealthy benefactors. which is the exception?A. the State University of New York.B. Yale University.C. Princeton University.D. Harvard University.

考题 Given: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.

考题 Which three methods of source NAT does the Junos OS support?() (Choose three.) A. interface-based source NATB. source NAT with address shiftingC. source NAT using static source poolD. interface-based source NAT without PATE. source NAT with address shifting and PAT

考题 In a three-disk volume group, a disk was physically removed from the system without performing any software procedures to properly remove the disk. Which of the following commands should be performed to recover from this error?()A.extendvgB.cfgmgrC.reducevgD.varyoffvg

考题 public class Foo {   public void main (String args) {   system.out.printIn(“Hello World.”);   }   }   What is the result? () A、 An exception is thrown.B、 The code does no compile.C、 “Hello World.” Is printed to the terminal.D、 The program exits without printing anything.

考题 int index = 1;   String test = new String;   String foo = test[index];  What is the result?()A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

考题 Which three methods of source NAT does the Junos OS support?() (Choose three.)A、interface-based source NATB、source NAT with address shiftingC、source NAT using static source poolD、interface-based source NAT without PATE、source NAT with address shifting and PAT

考题 1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()  A、 No code is necessary.B、 throws ExceptionC、 catch ( Exception e )D、 throws RuntimeExceptionE、 catch ( TestException e)

考题 public class ExceptionTest {   class TestException extends Exception {}   public void runTest () throws TestException {}   public void test () /* Point X*/ {   runTest ();   }   }   At point X on line 4, which code can be added to make the code compile?()  A、 Throws Exception.B、 Catch (Exception e).C、 Throws RuntimeException.D、 Catch (TestException e).E、 No code is necessary.

考题 In a three-disk volume group, a disk was physically removed from the system without performing any software procedures to properly remove the disk. Which of the following commands should be performed to recover from this error?()A、extendvgB、cfgmgrC、reducevgD、varyoffvg

考题 public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.

考题 import java.io.IOException;   public class ExceptionTest(   public static void main (Stringargs)  try (   methodA();   ) catch (IOException e) (   system.out.printIn(“Caught IOException”);  ) catch (Exception e) (   system.out.printIn(“Caught Exception”);   )   )   public void methodA () {   throw new IOException ();  }     What is the result?()  A、 The code will not compile.B、 The output is caught exception.C、 The output is caught IOException.D、 The program executes normally without printing a message.

考题 Which three will compile and rim 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 */ } }

考题 int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()  A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

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

考题 多选题Which three methods of source NAT does the Junos OS support?() (Choose three.)Ainterface-based source NATBsource NAT with address shiftingCsource NAT using static source poolDinterface-based source NAT without PATEsource NAT with address shifting and PAT

考题 多选题Class TestException  1. public class TestException extends Exception {  2. } Class a:  1. public class a {  2.  3. public String sayHello(String name) throws TestException {  4.  5. if(name == null) {  6. throw new TestException();  7. }  8.  9. return “Hello “+ name;  10. }  11.  12. }  A programmer wants to use this code in an application: 45. A a=new A();  46. System.out.println(a.sayHello(”John”));  Which two are true?()AClass a will not compile.BLine 46 can throw the unchecked exception TestException.CLine 45 can throw the unchecked exception TestException.DLine 46 will compile if the enclosing method throws a TestException.ELine 46 will compile if enclosed in a try block, where TestException is caught.

考题 单选题public class ExceptionTest {  class TestException extends Exception {}  public void runTest () throws TestException {}  public void test () /* Point X*/  {  runTest ();  }  }   At point X on line 4, which code can be added to make the code compile?()A  Throws Exception.B  Catch (Exception e).C  Throws RuntimeException.D  Catch (TestException e).E  No code is necessary.

考题 单选题What is the result?()A  foo has the value””B  foo has the value null.C  An exception is thrown.D  The code will not compile.

考题 单选题import java.io.IOException;  public class ExceptionTest(  public static void main (String[]args)  try (  methodA();  ) catch (IOException e)  (  system.out.printIn(“Caught IOException”);  ) catch (Exception e)   (  system.out.printIn(“Caught Exception”);  )  )  public void methodA ()   {  throw new IOException ();  }   What is the result?()A  The code will not compile.B  The output is caught exception.C  The output is caught IOException.D  The program executes normally without printing a message.

考题 单选题public class Plant {  private String name;  public Plant(String name) { this.name = name; }  public String getName() { return name; }  }  public class Tree extends Plant {  public void growFruit() { }  public void dropLeaves() { }  }  Which is true?()A  The code will compile without changes.B  The code will compile if public Tree() { Plant(); } is added to the Tree class.C  The code will compile if public Plant() { Tree(); } is added to the Plant class.D  The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E  The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.

考题 多选题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 */}

考题 单选题1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()A  Compilation fails.B  The code runs without exception.C  An exception is thrown at line 7.D  An exception is thrown at line 2.

考题 单选题public class Foo {  public void main (String [] args)   {  system.out.printIn(“Hello World.”); } }  What is the result?()A  An exception is thrown.B  The code does no compile.C  “Hello World.” Is printed to the terminal.D  The program exits without printing anything.

考题 单选题1. public class Exception Test {  2. class TestException extends Exception {}  3. public void runTest() throws TestException {}  4. public void test() /* Point X */ {  5. runTest();  6. }  7. }  At Point X on line 4, which code is necessary to make the code compile?()A  No code is necessary.B  throws ExceptionC  catch ( Exception e )D  throws RuntimeExceptionE  catch ( TestException e)

考题 单选题Three of the following are the main activities of the City of London. Which is the exception?A Government administration.B Buying and selling commodities.C Providing services and finance for commercial investment.D Stock exchanges.

考题 单选题Consider the following class:     class Test(int i) {     void test(int i) {  System.out.println(“I am an int.”); }    void test(String s) {   System.out.println(“I am a string.”);     }          public static void main(String args) {    Test t=new Test();     char ch=“y”;    t.test(ch);     }      }     Which of the statements below is true?()A  Line 5 will not compile, because void methods cannot be overridden.B  Line 12 will not compile, because there is no version of test() that rakes a charargument.C  The code will compile but will throw an exception at line 12.D  The code will compile and produce the following output: I am an int.E  The code will compile and produce the following output: I am a String.