Sunday, October 10, 2010

Throw exception through main method in java

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

No comments:

Post a Comment