The basic principle of Java error handling mechanism is that an exception must either be handled by the method in which it is raised or passed along the call chain for another method to handle it. Suppose a method throws an exception, that is neither a subclass of RuntimeException nor of Error i.e. if it throws a checked exception, then Java requires that the method either handles it or declares it. If the method does not handle the checked exception then the method must declare it using the throws keyword.