在finally
块中包含return
时,编译器会提示警告:finally block does not complete normally
-
在
try-chtch-finally
块中,无论前面的部分是否有return语句,finally块都会被执行。public class Test { public static void main(String[] args) { System.out.print(decision()); } public static boolean decision(){ try{ return