next up previous
Next: Checked exceptions and runtime Up: Unit 10 Previous: The most common types

The throws clause

All Java methods can use the throws clause to handle the exceptions generated by the methods they invoke.

The throws clause is added to the header of the method definition. For example:

public static void main(String[] args) throws IOException {
  ...
}


next up previous
Next: Checked exceptions and runtime Up: Unit 10 Previous: The most common types