下面代码输出什么?
package com.example.javademo;
public class RetrunFinally {
public static void main(String[] args) {
try {
System.out.println("return");
return;
} finally {
System.out.println("finally");
}
}
}
答案:
return
finally
记住:
finally
代码块总是执行!