单选题public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()A finallyB exception finishedC finally exception finishedD Compilation fails.

单选题
public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()
A

 finally

B

 exception finished

C

 finally exception finished

D

 Compilation fails.


参考解析

解析: 暂无解析

相关考题:

下列关于Test类的定义中,正确的是______。A) class Test implements Runnabte{public void run(){}public void someMethod(){}B) class Test implements Rnuuable{public void run();}C) class Test implements Rnuuable{public void someMethod();}D) class Test implements Rnuuable{public void someMethod();{}}A.B.C.D.

下列程序的执行结果是 ( ) public class Test { public int aMethod() { satic int i=0; i++; System.out.println(i); } public static void.main(String args[]) { Test test=new Test(); test.aMethod(); }A.编译错误B.0C.1D.运行成功,但不输出

下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

阅读下面程序 public class My Val{ public static void main(String args[]){ My Val m=new My Val(); m. amethod(); } public void amethod(){ boolean b[]=new Boolean[5]; } } 程序编译或运行结果是A.1B.nullC.D.编译不能过

下列代码的编译或执行结果是( )。 public class Myval{ public static void main(string args[]){ MyVal m=new MyVal; aMethod; } public void aMethod{ boolean b[]=new Boolean[5]; System.OUt.println(b[0]); } }A.1B.nullC.0D.编译错误

使用jdbc 编写class EnrollmentImpl 实现接口 Enrollment:public interface Enrollment{public void createStudent(Student student) throws Exception;pubic void createCourse(Course course) throws Exception;public void enroll(Student student, Course course) throws Exception;public void exam(Student, Course course, float grade) throws Exception;}

下列代码的执行结果是( )。public class Test{public int aMethod( ){static int i=0;i++;System.out.println(i):}public static void main (String args[]){Trest test=new Test ( );test aMethod( ):}}A.编译错误B.0C.1D.运行成功,但不输出B.C.D.

以下的程序的调试结果为?public class MyAr{public static void main(String argv[]) {MyAr m = new MyAr();m.amethod();}public void amethod(){static int i;System.out.println(i);}} A. 输出结果为 0B. 运行出错C. 输出结果为 nullD. 编译错误

public class TestA{    public void methodA() throws IOException{        //……    } }  public class TestB extends TestA{    public void methodA() throws EOFException{        //……   } }  public class TestC extends TestA{    public void methodA() throws Exception{        //……   } }  当编译类TestC的时候,结果是哪项?() A、 正常B、 编译错误C、 运行错误D、 以上都不对

Public class test (  Public static void main (String args[])  (  System.out.printIn (6 ^ 3);  )  )   What is the output?()

Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”);  StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  BufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  )  )   What is the output?()

public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()  A、 finallyB、 exception finishedC、 finally exception finishedD、 Compilation fails.

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.

public class X {  public X aMethod() { return this;}  }  public class Y extends X {  }  Which two methods can be added to the definition of class Y?()A、 public void aMethod() {}B、 private void aMethod() {}C、 public void aMethod(String s) {}D、 private Y aMethod() { return null; }E、 public X aMethod() { return new Y(); }

public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()  A、 0B、 1C、 2D、 Compilation fails.

public class Test {} What is the prototype of the default constructor?()  A、 Test()B、 Test(void)C、 public Test()D、 public Test(void)E、 public void Test()

单选题public class Test {  public static void aMethod() throws Exception {  try {  throw new Exception(); } finally {  System.out.println(“finally”);  }  }  public static void main(String args[]) {  try {  aMethod();  } catch (Exception e) {  System.out.println(“exception”);  }  System.out.println(“finished”);  }  }  What is the result?()A finallyB exception finishedC finally exception finishedD Compilation fails.

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

单选题public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()A 0B 1C 2D Compilation fails.

多选题public class X {  public X aMethod() { return this;}  }  public class Y extends X {  }  Which two methods can be added to the definition of class Y?()Apublic void aMethod() {}Bprivate void aMethod() {}Cpublic void aMethod(String s) {}Dprivate Y aMethod() { return null; }Epublic X aMethod() { return new Y(); }

填空题Public class test (    Public static void main (String args) (   System.out.printIn (6^3);   )   )   What is the output? ()

单选题public class TestA{   public void methodA()  throws IOException{   //……   }   }   public class TestB extends TestA{   public void methodA()  throws EOFException{   //……   }   }   public class TestC extends TestA{   public void methodA()  throws Exception{   //……   }   }   当编译类TestC的时候,结果是哪项?()A 正常B 编译错误C 运行错误D 以上都不对

单选题public class test(    public int aMethod()[   static int i=0;   i++;   return I;   )    public static void main (String args){   test test = new test();    test.aMethod();   int j = test.aMethod();   System.out.printIn(j);   ]  }   What is the result?()A Compilation will fail.B Compilation will succeed and the program will print “0”C Compilation will succeed and the program will print “1”D Compilation will succeed and the program will print “2”

单选题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 Test {   public static void replaceJ(string text) {   text.replace (‘j‘, ‘l‘);   }   public static void main(String args) {   string text = new String (“java”)   replaceJ(text);   system.out.printIn(text);   }   }   What is the result?()A The program prints “lava”B The program prints “java”C An error at line 7 causes compilation to fail.D Compilation succeeds but the program throws an exception.

单选题下列代码的编译或执行结果是(  )。public class MyVal{ public static void main(String args[]){ MyVal m = new MyVal(); m.aMethod(); } public void aMethod(){ boolean b[] = new Boolean[5]; System.out.println(b[0]); }}A1BnullC0D编译错误

单选题public class Test {} What is the prototype of the default constructor?()A Test()B Test(void)C public Test()D public Test(void)E public void Test()