问题 单项选择题

阅读下面程序public class Test implements Runnable{ public static void main(String[]args){ _______________________________________; t. start(); } public void mR(){ System. out. println("Hello!"); }    } 在程序下画线处填入正确选项是

A.Test t=flew Test()

B.Thread t=new Thread();

C.Thread t=new Thread(new Test());

D.Test t=new Thread();

答案

参考答案:C

解析: 根据t. start()可知t应该是一个Thread类,排除A)。Thread类与Test类之间没有继承关系,所以排除D)。B)没有指定创建线程的对象,因此t. start()语句不能使Test类的run方法运行。所以选C)。

选择题
名词解释