Online Java Compiler By
JavaTpoint.com
import java.io.*; class M{ void method()throws IOException{ throw new IOException("device error"); } } class Testthrows4{ public static void main(String args[])throws IOException{//declare exception M m=new M(); m.method(); System.out.println("normal flow..."); } }
Output