throws keyword in java

The “throws” keyword can be applied to a method to indicate that, the method raises particular types of exceptions and it is not handling that exception. So this signals the caller that, It has to handle the exception thrown by the method. Example:  public class ReadFileExample  {         public method readFile(String filename) […]

Share this article on