标签:java 自定义exception
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);
}
}
标签:java 自定义exception
原文地址:http://blog.csdn.net/cjc211322/article/details/24811021