<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2-rc) on Fri Jun 13 00:14:21 PDT 2003 -->
<TITLE>
Error (Java 2 Platform SE v1.4.2)
</TITLE>
<META NAME="keywords" CONTENT="java.lang.Error class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Error (Java 2 Platform SE v1.4.2)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Error.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/ClassFormatError.html" title="class in java.lang"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/ExceptionInInitializerError.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Error.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.lang</FONT>
<BR>
Class Error</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/lang/Throwable.html" title="class in java.lang">java.lang.Throwable</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.lang.Error</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../java/lang/AssertionError.html" title="class in java.lang">AssertionError</A>, <A HREF="../../java/awt/AWTError.html" title="class in java.awt">AWTError</A>, <A HREF="../../java/nio/charset/CoderMalfunctionError.html" title="class in java.nio.charset">CoderMalfunctionError</A>, <A HREF="../../javax/xml/parsers/FactoryConfigurationError.html" title="class in javax.xml.parsers">FactoryConfigurationError</A>, <A HREF="../../java/lang/LinkageError.html" title="class in java.lang">LinkageError</A>, <A HREF="../../java/lang/ThreadDeath.html" title="class in java.lang">ThreadDeath</A>, <A HREF="../../javax/xml/transform/TransformerFactoryConfigurationError.html" title="class in javax.xml.transform">TransformerFactoryConfigurationError</A>, <A HREF="../../java/lang/VirtualMachineError.html" title="class in java.lang">VirtualMachineError</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>Error</B><DT>extends <A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A></DL>
<P>
An <code>Error</code> is a subclass of <code>Throwable</code>
that indicates serious problems that a reasonable application
should not try to catch. Most such errors are abnormal conditions.
The <code>ThreadDeath</code> error, though a "normal" condition,
is also a subclass of <code>Error</code> because most applications
should not try to catch it.
Error是Throwable的子类,表明正常应用中不能捕获的严重问题。大部分这样的错误
都是非正常条件下发生,ThreadDeath错误,尽管是“正常”条件,也是Error的子类因为大部分应用程序不应当
捕获它。
<p>
A method is not required to declare in its <code>throws</code>
clause any subclasses of <code>Error</code> that might be thrown
during the execution of the method but not caught, since these
errors are abnormal conditions that should never occur.
任何Error的子类不需要方法的throws子句中声明抛出,因为在执行该方法中
可以被抛出但不能被捕获,因为这些错误是在非正常条件下发生的。(原文有误)
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/ThreadDeath.html" title="class in java.lang"><CODE>ThreadDeath</CODE></A>,
<A HREF="../../serialized-form.html#java.lang.Error">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Error.html#Error()">Error</A></B>()</CODE>
<BR>
Constructs a new error with <code>null</code> as its detail message.
创建一个详细信息为null的Error。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Error.html#Error(java.lang.String)">Error</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> message)</CODE>
<BR>
Constructs a new error with the specified detail message.
创建一个指定详细信息的Error。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Error.html#Error(java.lang.String, java.lang.Throwable)">Error</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> message,
<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A> cause)</CODE>
<BR>
Constructs a new error with the specified detail message and
cause.创建一个指定详细信息和原由的Error。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Error.html#Error(java.lang.Throwable)">Error</A></B>(<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A> cause)</CODE>
<BR>
Constructs a new error with the specified cause and a detail
message of <tt>(cause==null ? null : cause.toString())</tt> (which
typically contains the class and detail message of <tt>cause</tt>).
创建一个指定详细信息和原由(cause==null ? null : cause.toString())(通常包括cause的类和详细信息)的Error。</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Throwable.html#fillInStackTrace()">fillInStackTrace</A>, <A HREF="../../java/lang/Throwable.html#getCause()">getCause</A>, <A HREF="../../java/lang/Throwable.html#getLocalizedMessage()">getLocalizedMessage</A>, <A HREF="../../java/lang/Throwable.html#getMessage()">getMessage</A>, <A HREF="../../java/lang/Throwable.html#getStackTrace()">getStackTrace</A>, <A HREF="../../java/lang/Throwable.html#initCause(java.lang.Throwable)">initCause</A>, <A HREF="../../java/lang/Throwable.html#printStackTrace()">printStackTrace</A>, <A HREF="../../java/lang/Throwable.html#printStackTrace(java.io.PrintStream)">printStackTrace</A>, <A HREF="../../java/lang/Throwable.html#printStackTrace(java.io.PrintWriter)">printStackTrace</A>, <A HREF="../../java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])">setStackTrace</A>, <A HREF="../../java/lang/Throwable.html#toString()">toString</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Error()"><!-- --></A><H3>
Error</H3>
<PRE>
public <B>Error</B>()</PRE>
<DL>
<DD>Constructs a new error with <code>null</code> as its detail message.
The cause is not initialized, and may subsequently be initialized by a
call to <A HREF="../../java/lang/Throwable.html#initCause(java.lang.Throwable)"><CODE>Throwable.initCause(java.lang.Throwable)</CODE></A>.
创建一个详细信息为null的Error。cause没有被初始化,可以随后调用Throwable.initCause来初始化。
<P>
</DL>
<HR>
<A NAME="Error(java.lang.String)"><!-- --></A><H3>
Error</H3>
<PRE>
public <B>Error</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> message)</PRE>
<DL>
<DD>Constructs a new error with the specified detail message. The
cause is not initialized, and may subsequently be initialized by
a call to <A HREF="../../java/lang/Throwable.html#initCause(java.lang.Throwable)"><CODE>Throwable.initCause(java.lang.Throwable)</CODE></A>.
创建一个指定详细信息的Error。cause没有被初始化,可以随后调用Throwable.initCause来初始化。
<P>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - the detail message. The detail message is saved for
later retrieval by the <A HREF="../../java/lang/Throwable.html#getMessage()"><CODE>Throwable.getMessage()</CODE></A> method.
详细信息,可以通过Throwable.getMessage()方法获得。</DL>
<HR>
<A NAME="Error(java.lang.String, java.lang.Throwable)"><!-- --></A><H3>
Error</H3>
<PRE>
public <B>Error</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> message,
<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A> cause)</PRE>
<DL>
<DD>Constructs a new error with the specified detail message and
cause. 创建一个指定详细信息和cause的Error。
<p>Note that the detail message associated with
<code>cause</code> is <i>not</i> automatically incorporated in
this error's detail message.
注意和cause关联的详细信息不会自动和错误的详细信息合为一体。
<P>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - the detail message (which is saved for later retrieval
by the <A HREF="../../java/lang/Throwable.html#getMessage()"><CODE>Throwable.getMessage()</CODE></A> method).
通过Throwable.getMessage()方法获得的详细信息。<DD><CODE>cause</CODE> - the cause (which is saved for later retrieval by the
<A HREF="../../java/lang/Throwable.html#getCause()"><CODE>Throwable.getCause()</CODE></A> method). (A <tt>null</tt> value is
permitted, and indicates that the cause is nonexistent or
unknown.)通过Throwable.getCause()方法获得的原由(原由为空是允许的,表明原由不存在或未知)。<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
<HR>
<A NAME="Error(java.lang.Throwable)"><!-- --></A><H3>
Error</H3>
<PRE>
public <B>Error</B>(<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A> cause)</PRE>
<DL>
<DD>Constructs a new error with the specified cause and a detail
message of <tt>(cause==null ? null : cause.toString())</tt> (which
typically contains the class and detail message of <tt>cause</tt>).
This constructor is useful for errors that are little more than
wrappers for other throwables.
创建一个指定详细信息和cause的Error(cause==null ? null : cause.toString())(通常包括cause的类和详细信息)。
此构造函数不比其他throwable的包装有用。
<P>
<DT><B>Parameters:</B><DD><CODE>cause</CODE> - the cause (which is saved for later retrieval by the
<A HREF="../../java/lang/Throwable.html#getCause()"><CODE>Throwable.getCause()</CODE></A> method). (A <tt>null</tt> value is
permitted, and indicates that the cause is nonexistent or
unknown.)通过Throwable.getCause()方法获得的原由(原由为空是允许的,表明原由不存在或未知)。<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Error.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/ClassFormatError.html" title="class in java.lang"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/ExceptionInInitializerError.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Error.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
</BODY>
</HTML>