MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

/*
 * 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");
    }
}