java.lang

接口
类
异常
错误
注释
java.lang.Object
  继承者 java.lang.Throwable
      继承者 java.lang.Exception
          继承者 java.lang.InstantiationException
所有已实现的接口:
Serializable

public class InstantiationException
     
extends Exception

当应用程序试图使用 Class 类中的 newInstance 方法创建一个类的实例,而指定的类对象无法被实例化时,抛出该异常。实例化失败有很多原因,包括但不仅限于以下原因:

  • 类对象表示一个抽象类、接口、数组类、基本类型、void
  • 类没有非 null 构造方法

从以下版本开始:
JDK1.0
另请参见:
Class.newInstance(), 序列化表格

构造方法摘要
InstantiationException()
          构造不带详细消息的 InstantiationException。
InstantiationException(String s)
          构造带指定详细消息的 InstantiationException。
 
方法摘要
 
从类 java.lang.Throwable 继承的方法
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

InstantiationException

public InstantiationException()
构造不带详细消息的 InstantiationException。


InstantiationException

public InstantiationException(String s)
构造带指定详细消息的 InstantiationException。

参数:
s - 详细消息。