It means that if a method declares to throw a given exception, the overriding method in a subclass can only declare to throw that exception or its subclass (equal or lower in hierarchy or no exception).
Reason to not throw the exception of higher hierarchy in java
This is because of runtime polymorphism.
As given in above example, we are throwing the SQLException from method2() of ParentClass. At the compile time, we handled the SQLException because compiler doesn’t aware about Parent class reference will contain the instance of child class at runtime.
But due to runtime polymorphism, the method of base class of exception hierarchy and the catch block will not capable to handle this higher hierarchy Exception.
Therefore, throwing the exception of higher hierarchy is not allowed in java.