Throws

23/11/2009 17:17

/*******************************************************************
Program name:Write a java program to demonstrating throws
Roll no:12
*******************************************************************/
class Demothrows
{
static void throwmeth()throws IllegalAccessException
{
System.out.println("Inside throwmeth");
throw new IllegalAccessException("Demo");
}
public static void main(String args[])
{
try
{
throwmeth();
}
catch(IllegalAccessException e)
{
System.out.println("Caught Exception"+e);
}
}
}

Back

Search site

Copyright © 2012 Dadaso Zanzane. All rights reserved.