class pro4
{
static void throwOne() throws IllegalAccessException
{
System.out.println("Inside throwOne.");
throw new IllegalAccessException("DEMO");
}
public static void main(String args[])
{
try
{
throwOne();
}
catch(IllegalAccessException e)
{
System.out.println("Caught"+e);
}
}
}