The throws keyword is used in method signatures to indicate that a method might throw one or more exceptions.
Source Code
public void readFile(String fileName) throws IOException {
// Code that might throw IOException
}
Use throws to delegate the responsibility of exception handling to the caller of the method, making your error handling strategy more flexible.