06-04-2011, 01:22 PM
Code:
import java.*;
class Myexception extends Exception
{
Myexception(String n)
{
super(n);
}
}
class Throwdemo
{
public static void main(String arg[])
{
Myexception me=new Myexception("This is from me");
try
{
throw me;
}
catch(Myexception g)
{
System.out.println(g);
}
}
}
OUTPUT
E:\3msc\java\joby>java Throwdemo
Myexception: This is from me