- java.lang.Object
 -  
      
- java.lang.Throwable
 -  
        
- java.lang.Exception
 -  
          
- java.lang.RuntimeException
 -  
            
- java.lang.IllegalStateException
 
 
 
 
 
-  
       
- 实现的所有接口
 -  
         
Serializable 
- 已知直接子类:
 -  
         
AcceptPendingException,AlreadyBoundException,AlreadyConnectedException,CancellationException,CancelledKeyException,ClosedDirectoryStreamException,ClosedFileSystemException,ClosedSelectorException,ClosedWatchServiceException,ConnectionPendingException,FormatterClosedException,IllegalBlockingModeException,IllegalComponentStateException,IllegalReceiveException,IllegalUnbindException,InvalidDnDOperationException,InvalidMarkException,NoConnectionPendingException,NonReadableChannelException,NonWritableChannelException,NotYetBoundException,NotYetConnectedException,OverlappingFileLockException,ReadPendingException,ShutdownChannelGroupException,WritePendingException 
public class IllegalStateException extends RuntimeException
表示在非法或不适当的时间调用了方法。 换句话说,Java环境或Java应用程序未处于所请求操作的适当状态。- 从以下版本开始:
 - 1.1
 - 另请参见:
 - Serialized Form
 
 
-  
        
       
-  
             
构造方法摘要
构造方法 构造器 描述 IllegalStateException()构造一个没有详细消息的IllegalStateException。IllegalStateException(String s)使用指定的详细消息构造IllegalStateException。IllegalStateException(String message, Throwable cause)使用指定的详细消息和原因构造一个新的异常。IllegalStateException(Throwable cause)构造具有指定的原因和详细消息的新异常(cause==null ? null : cause.toString())(它通常包含的类和详细消息cause)。 
-  
             
方法摘要
 
 -  
             
 
-  
        
       
-  
             
构造方法详细信息
-  
IllegalStateException
public IllegalStateException()
构造一个没有详细消息的IllegalStateException。 详细消息是描述此特定异常的String。 
-  
IllegalStateException
public IllegalStateException(String s)
使用指定的详细消息构造IllegalStateException。 详细消息是描述此特定异常的String。- 参数
 -  
              
s- 包含详细消息的字符串 
 
-  
IllegalStateException
public IllegalStateException(String message, Throwable cause)
使用指定的详细消息和原因构造一个新的异常。请注意,与
cause关联的详细消息不会自动合并到此异常的详细消息中。- 参数
 -  
              
message- 详细消息(保存以供以后通过Throwable.getMessage()方法检索)。 -  
              
cause- 原因(保存以供以后通过Throwable.getCause()方法检索)。 (允许值为null,表示原因不存在或未知。) - 从以下版本开始:
 - 1.5
 
 
-  
IllegalStateException
public IllegalStateException(Throwable cause)
构造具有指定的原因和详细消息的新异常(cause==null ? null : cause.toString())(它通常包含的类和详细消息cause)。 此构造函数对于仅比其他throwable的包装器更多的异常非常有用(例如,PrivilegedActionException)。- 参数
 -  
              
cause- 原因(保存以供以后通过Throwable.getCause()方法检索)。 (允许值为null,表示原因不存在或未知。) - 从以下版本开始:
 - 1.5
 
 
 -  
 
 -