new IllegalAccessException(String name) : IllegalAccessException « java.lang « Java by API






new IllegalAccessException(String name)

/*
 * Output:
 * 
Exception in thread "main" java.lang.IllegalAccessException: demo
caught inside procedure
  at MainClass.main(MainClass.java:12)
 * 
 *  
 */

public class MainClass {
  public static void main(String args[]) throws Exception{
    System.out.println("caught inside procedure");
    throw new IllegalAccessException("demo");
  }
}
           
       








Related examples in the same category