1.自定义异常类 MyException,该类继承自 Exception 类
public class TestMyException{
public static void main(String args[]) throws MyException{
public String toString() {
String s = getClass().getName();
String message = getLocalizedMessage();
return (message != null) ? (s + ": " + message) : s;
}
TestMyException.MyException();
} catch(MyException e1) ...{
System.out.println("Exception: " + e1.getMessage());
e1.printStackTrace();
扩展资料:
java.awt.datatransfer类 MimeTypeParseException
java.lang.Object
java.lang.Throwablejava.lang.Exception
java.awt.datatransfer.MimeTypeParseException
所有已实现的接口
Serializablepublic class MimeTypeParseException extends Exception
对分析相关异常的 MimeType 进行封装的类
参考资料来源:百度百科-MimeTypeParseException类