摘要: 异常处理的5个关键字:try,catch,finally,throw和throws♦try:把要监控异常的代码放在try块里♦catch:用来捕获异常并处理异常 1 /*file:ExceptionDemo.java;除数为零的异常处理*/ 2 public class ExceptionDemo 3 { 4 public static void main(String[] args) 5 { 6 int n1=10; 7 int n2=0; 8 try 9 {10 int result=n... 阅读全文
posted @ 2013-01-15 15:14 诗诺·克劳德 阅读(153) 评论(0) 推荐(0)