What is the difference between checked exceptions and unchecked exceptions?
Solution: Java has two kinds of exceptions: checked and unchecked. Checked exceptions are subclasses of Exception that are not subclasses of RuntimeExceptions. Any checked exception that may be thrown in a method must be either caught by that method or declared in the method’s throws clause. An unchecked exception does not need to be caught. RuntimeException is a subclass of Exception and is an unchecked exception. RuntimeException’s are generally indicative of software bugs. For example, NullPointerException is a subclass of RuntimeException and is unchecked. This exception can be thrown just about anywhere in a program. Whenever an attempt is made to deference null a NullPointerException is thrown. It would be counterintuitive to require that such exceptions be caught in the code, because it is impossible to predict exactly where these exceptions may happen.