Throwing Exceptions : throw « Statements « SCJP






import java.io.IOException;

public class MainClass {
  public static void main(String[] argv) {
    System.out.println();
  }

  public static void m() throws IOException {
    IOException x = new IOException("your message.");
    throw x;

  }
}








5.12.throw
5.12.1.Throwing Exceptions
5.12.2.Rethrowing Exceptions