下列程序执行的结果是( )。
public class X7_1_6 {
public static void main(String[] args) {
try{
return;
}
finally{
System.out.println("Finally");
}
}
}
public class X7_1_6 {
public static void main(String[] args) {
try{
return;
}
finally{
System.out.println("Finally");
}
}
}
举一反三
- (9-3)执行以下程序的输出结果是。 public class Demo { public static void main(String[] args) { try { return; } finally { System.out.println("1"); } } }
- 写出程序的运行结果。 public class Demo{ public static void main(String args[]) { int b = get(); System.out.println(b); } public static int get() { try { return 1; } finally { return 2; } } }
- 下面程序的执行结果是( )。public class Test {public static void main(String[] args) {new Test().test();}public void test(){try{System.out.print("try");}catch(ArrayIndexOutOfBoundsException e){System.out.print("catch1");}catch(Exception e){System.out.print("catch2");}finally{System.out.println("finally");}}} A: try finally B: try catch1 finally C: try catch2 finally D: finally
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }
- 请说出下列程序的输出结果_____________,_____________。import java.io.IOException;public class E {public static void main(String args[]){try { methodA();}catch(IOException e){System.out.print("你好");return;}finally {System.out.println("thanks");}}public static void methodA() throws IOException{throw new IOException();}}