Mega Code Archive

 
Categories / Java Tutorial / Language
 

Throw Exception through main method

public class MainClass {   public static void main(String[] args) throws Throwable {     try {       throw new Throwable();     } catch (Exception e) {       System.err.println("Caught in main()");     }   } }