The fifth chapter anomaly one, exception overview
Overview: Exceptions are abnormal events that occur during a program's run, and he interrupts a running program
Second, exception handling
1. Keyword: Try Catch finally throw throws
2.Try: Put the code that might appear to be abnormal in the Try
3.Catch: Catching exceptions
4.Finally: Code that executes regardless of whether there is an exception
5.Throw: Always appear in the method body
6.Throws: Always appears in the declaration of the method, using the various exceptions that indicate that the modification method may be thrown
Three: Common exceptions
Exception: Root class for exception hierarchies
ArithmeticException: The case of arithmetic error,
ArrayIndexOutOfBoundsException: Array greater than or less than the size of the actual array
NullPointerException: Attempting to access a null object member
ClassNotFoundException: To get the data type mismatch with the actual input type
IllegalArgumentException: Illegal parameters accepted by method
Four: log4i Record day file information
The log file has an output priority:
From high to Low: Error warn info debug
Using Java to implement object-oriented fifth chapter