Exception
An exception (or exceptional event) is a problem that arises during the execution of a program.
Checked exceptions: A checked exception is an exception that occurs at the compile time. Unchecked exceptions: An Unchecked exception is an exception that occurs at the time of execution, these are also called as Runtime Exceptions.
If a method does not handle a checked exception, the method must declare it using the throws keyword. The throws keyword appears at the end of a method's signature.
所有异常类的祖先都是Throwable类,Throwable的两个子类是Error和Exception类。The Exception class has two main subclasses : IOException class and RuntimeException Class.
The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred.
NullPointerException: A NullPointerException is thrown when calling the instance method of a null object, accessing or modifying the field of a null object etc. ArithmeticException: is thrown when integer is divided by zero or taking the remainder of a number by zero. It is never thrown in floating-point operations.