Program to Demonstrates 'throws' clause

/* Program to Demonstrates 'throws' */

class ExceptionDemo7
{
    static void procedure() throws IllegalAccessException
    {
       
        System.out.println(" Inside 'procedure( )'.....");
        throw new IllegalAccessException("throwsDemo");   
       
    }


    public static void main(String args[ ])
    {
        try
        {
            procedure();
        }
        catch(IllegalAccessException e)  
        {      
                System.out.println(" Caught Exception...."+e);   
        }
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|