classnotfoundexception.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 361 行 · 第 1/2 页
HTML
361 行
<!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.5.0_03) on Wed Nov 02 09:48:20 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>ClassNotFoundException (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.lang.ClassNotFoundException class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="ClassNotFoundException (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 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>概述</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClassNotFoundException.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</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>Standard Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="ClassLoader.html" title="java.lang 中的类"><B>上一个类</B></A> <A HREF="Cloneable.html" title="java.lang 中的接口"><B>下一个类</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html@java_2Flang_2FClassNotFoundException.html" target="_top"><B>框架</B></A> <A HREF="ClassNotFoundException.html" target="_top"><B>无框架</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要: 嵌套 | 字段 | <A HREF="#constructor_summary">构造方法</A> | <A HREF="#method_summary">方法</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">详细信息: 字段 | <A HREF="#constructor_detail">构造方法</A> | <A HREF="#method_detail">方法</A></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>类 ClassNotFoundException</H2><PRE><A HREF="Object.html" title="java.lang 中的类">java.lang.Object</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><A HREF="Throwable.html" title="java.lang 中的类">java.lang.Throwable</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><A HREF="Exception.html" title="java.lang 中的类">java.lang.Exception</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><B>java.lang.ClassNotFoundException</B></PRE><DL><DT><B>所有已实现的接口:</B> <DD>java.io.Serializable</DD></DL><HR><DL><DT><PRE>public class <B>ClassNotFoundException</B><DT>extends <A HREF="Exception.html" title="java.lang 中的类">Exception</A></DL></PRE><P>当应用程序试图使用以下方法通过字符串名加载类时,抛出该异常:<ul><li><code>Class</code> 类中的 <code>forName</code> 方法。<li><code>ClassLoader</code> 类中的 <code>findSystemClass</code> 方法。<li><code>ClassLoader</code> 类中的 <code>loadClass</code> 方法。</ul><p>但是没有找到具有指定名称的类的定义。 <p>从 1.4 版本开始,此异常已经更新,以符合通用的异常链机制。在构造时提供并通过 <A HREF="ClassNotFoundException.html#getException()"><CODE>getException()</CODE></A> 方法访问的“加载类时引发的可选异常”,现在被称为<i>原因</i>,它可以通过 <A HREF="Throwable.html#getCause()"><CODE>Throwable.getCause()</CODE></A> 方法以及与上面提到的“遗留方法”来访问。<P><P><DL><DT><B>从以下版本开始:</B></DT> <DD>JDK1.0</DD><DT><B>另请参见:</B><DD><A HREF="Class.html#forName(java.lang.String)"><CODE>Class.forName(java.lang.String)</CODE></A>, <A HREF="ClassLoader.html#findSystemClass(java.lang.String)"><CODE>ClassLoader.findSystemClass(java.lang.String)</CODE></A>, <A HREF="ClassLoader.html#loadClass(java.lang.String, boolean)"><CODE>ClassLoader.loadClass(java.lang.String, boolean)</CODE></A>, <A HREF="../../serialized-form.html#java.lang.ClassNotFoundException">序列化表格</A></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>构造方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="ClassNotFoundException.html#ClassNotFoundException()">ClassNotFoundException</A></B>()</CODE><BR> 构造不带详细消息的 <code>ClassNotFoundException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="ClassNotFoundException.html#ClassNotFoundException(java.lang.String)">ClassNotFoundException</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> s)</CODE><BR> 构造带指定详细消息的 <code>ClassNotFoundException</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="ClassNotFoundException.html#ClassNotFoundException(java.lang.String, java.lang.Throwable)">ClassNotFoundException</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A> s, <A HREF="Throwable.html" title="java.lang 中的类">Throwable</A> ex)</CODE><BR> 构造一个 <code>ClassNotFoundException</code>,它带有指定详细消息和加载类时引发的可选异常。</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Throwable.html" title="java.lang 中的类">Throwable</A></CODE></FONT></TD><TD><CODE><B><A HREF="ClassNotFoundException.html#getCause()">getCause</A></B>()</CODE><BR> 返回此异常的原因(尝试加载类时发生错误引发的异常;否则返回 <tt>null</tt>)。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Throwable.html" title="java.lang 中的类">Throwable</A></CODE></FONT></TD><TD><CODE><B><A HREF="ClassNotFoundException.html#getException()">getException</A></B>()</CODE><BR>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?