If a method does not throw an checked Exception directly but calls a method that throws an exception then the calling method must handle the throw exception or declare the exception in its throws clause. If the calling method does not handle and declares the exception the exceptions is passed to the next method in the method stack. This is known as ducking the exception down the method stack.
e.g. The code below 'll not compile as the getCar() method has not declared the CarNotFoundException which is thrown by the getColor () method.
void getFlower() {
getType();
}
void getFlower () {
throw new CarNotFoundException();
}
Fix for the above code is
void getFlower() throws CarNotFoundException {
getType();
}
void getFlower () {
throw new CarNotFoundException();
}