===Exception
1. Syntax
try {....
throw Exception;
}catch(Exception_Type1 e){
...
}catch(Exception_Type2 e){
...
}catch(Exception_Type3 e){
...
}finally{
...
}
2. class Exception
class Throwable ->class Exception ==> program error
class Throwable->class Exception ->class RuntimeException
class Throwable->class Error ==>JVM error
Exception(String s)
3. Throws: don't handle exception in current method
public void div(int i, int j) throws Exception:
5. Exception must be caught except for RuntimeException
没有评论:
发表评论