阅读下面程序 public class Test implements Runnable{ public static void main(String[]args){ __________________

admin2009-08-24  19

问题 阅读下面程序        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)。
转载请注明原文地址:https://kaotiyun.com/show/P0np777K
0

最新回复(0)