runtime exception:logic error of Developers' code .such as NullPointerException,IndexOutOfBoundsException and so on.other exception: The developers must catch this kind of exceptions and handle them. such as IOException,ClassNotFoundException,and so on.
try{
}catch(Exception e){
e.printStackTrace();或e.getMessage();
有些要自己处理!!
恩
try{
line58; //出错语句
line59; //该句和之后的语句不会执行
...
}
catch (Exception e){
... //错误处理
}
finally{
... //必须执行
}
当Line58处的句子产生了异常,就不执行try语句块中Line58后面的句子,在catch语句块中捕获异常,给出异常信息,最后还得执行finally语句块中的内容。