JavaTM 2 Platform
Standard Ed. 6

java.lang
类 InterruptedException

java.lang.Object
  继承者 java.lang.Throwable
      继承者 java.lang.Exception
          继承者 java.lang.InterruptedException
所有已实现的接口:
Serializable

public class InterruptedException
extends Exception

当线程在活动之前或活动期间处于正在等待、休眠或占用状态且该线程被中断时,抛出该异常。有时候,一种方法可能希望测试当前线程是否已被中断,如果已被中断,则立即抛出此异常。下列代码可以达到这种效果:

  if (Thread.interrupted())  // Clears interrupted status!
      throw new InterruptedException();
 

从以下版本开始:
JDK1.0
另请参见:
Object.wait(), Object.wait(long), Object.wait(long, int), Thread.sleep(long), Thread.interrupt(), Thread.interrupted(), 序列化表格

构造方法摘要
InterruptedException()
          构造不带详细消息的 InterruptedException
InterruptedException(String s)
          构造带指定详细消息的 InterruptedException
 
方法摘要
 
从类 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
 

构造方法详细信息

InterruptedException

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


InterruptedException

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

参数:
s - 详细消息。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only