单项选择题

下列方法中,声明抛出InterruptedException类型异常的方法是

A.suspend()
B.resume()
C.sleep()
D.start()
<上一题 目录 下一题>
热门 试题

单项选择题
如果使用Thread t=new Test()语句创建一个线程,则下列叙述正确的是
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable的子类
D.Test类一定是继承Thread类并且实现Runnable接口
单项选择题
阅读下面程序 class Test implements Runnable { public static void main(String[] args) { Test t = new Test(); t.startO; } public void run(){ } } 下列关于上述程序的叙述正确的是()

A.程序不能通过编译,因为start()方法在Test类中没有定义
B.程序编译通过,但运行时出错,提示start()方法没有定义
C.程序不能通过编译,因为run()方法没有定义方法体
D.程序编译通过,且运行正常

相关试题
  • 阅读下面程序 import java.io.*; pu...
  • 如果线程正处于运行状态,可使该线程进入阻...