java自定义Exception
时间:2014-04-30 22:32:40
收藏:0
阅读:250
public class JavaTest
{
public static void main(String[] args)
{
try
{
throw new DefaultException("This is a defined Exception!");
}
catch(DefaultException e)
{
System.out.println(e);
}
}
}
class DefaultException extends Exception
{
public DefaultException(String msg)
{
super(msg);
}
}
评论(0)