Checked exceptions are subject to the Catch or Specify Requirement.
All exceptions are checked exceptions, except for those indicated by
Error, RuntimeException, and their subclasses.
It says all the exceptions needs to be handled either by catching them
try{
call();
}catch(SomeException ex){
//handling
}
or by throwing back
public void caller() throws SomeException{
call();
}
call();
method is declared to throw SomeException
public void caller(){
call();
}
This will not compile,
There are RuntimeException
which are unchecked, you don't need to handle them, they are mainly unexpected ones (some of them are errors) so we don't have to forcibly handle them
See Also