finally 语句
package unit5; public class FinallyDemo { int no1,no2; public FinallyDemo(String[] args) { try{ no1=Integer.parseInt(args[0]); no2=Integer.parseInt(args[1]); System.out.println("相除结果结果为:"+no1/no2); }catch(ArithmeticException e1){ System.out.println("除数不能为0"); }catch (NumberFormatException e2) { System.out.println("必须输入数字"); }finally{ System.out.println("Finally 已执行,用于做清理"); } } public static void main(String[] args) { new FinallyDemo(args); } }