下列()方法可以创建线程。
第1题:
如果使用 Thread t = new Test() 语句创建一个线程,则下列叙述正确的是
A)Test 类一定要实现 Runnable 接口
B)Test 类一定是 Thread 类的子类
C)Test 类一定是 Runnable 的子类
D)Test 类一定是继承 Thread 类并且实现 Runnable 接口
第2题:
A.通过Thread类的构造方法创建线程
B.Thread类提供了start()方法创建线程
C.通过实现Runnable接口创建线程
D.通过使用Thread类提供的interrupt()方法创建线程
第3题:
当使用SomeThread t=new SomeThread()创建一个线程时,下列叙述中正确的是( )。
A.SomeThread类是包含run()方法的任意Java类
B.SomeThread类一定要实现Runnable接口
C.SomeThread类是Thread类的子类
D.SomeThread类是Thread类的子类并且要实现Runnable接口
第4题:
当使用SomeThread t=new SomeThread( )创建-个线程时,下列叙述中正确的是( )。
A.Some Thread类是包含run( )方法的任意Java类
B.Some Thread类-定要实现Runnable接口
C.Some Thread类是Thread类的子类
D.Some Thread类是Thread类的子类并且要实现Run-nable接口
第5题:
创建线程有两种方法,一种是继承线程类Thread,另一种是______。
A.建立实现Runnable接口的类
B.直接创建线程即可,无需实现任何接口
C.建立实现Collection接口的类
D.建立实现Thread接口的类
第6题:
下列方法中可以用来创建一个新线程的是( )。
A.实现java.lang.Runnable接口并重写start()方法
B.实现java.lang.Runnable接口并重写run()方法
C.继承java.lang.Thread类并重写run()方法
D.实现java.lang.Thread类并实现start()方法
第7题:
关于Runnable接口,错误的说法是 ( )
A.实现接口Runnable的类仍然可以继承其他父类
B.创建实现Runnable接口的类后,就可以用start方法启动线程了
C.Runable接口提供了通过线程执行程序的最基本的接口
D.Runnable只定义了一个run方法
第8题:
下列叙述正确的是( )。
A.线程的执行从run()方法开始,需要调用start()方法运行线程
B.可以通过实现Runnable接口,并且重写start()方法创建线程
C.可以通过继承Thread类,并且重写start()方法创建进程
D.线程执行从start()方法开始,需要通过调用run()方法运行线程
第9题:
如果使用Thread t=new Test()语句创建一个线程,则下列叙述正确的是
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable的子类
D.Test类一定是继承Thread类并且实现Runnable接口
第10题:
当使用SomeThread t=new SomeThread( )创建一个线程时,下列叙述中正确的是( )。
A.SomeThread类是包含run( )方法的任意Java类
B.SomeThread类-定要实现Runnable接口
C.SomeThread类是Thread类的子类
D.SomeThread类是Thread类的子类并且要实现Run-nable接口