如果使用Thread t=new Test()语句创建一个线程,则下列叙述正确的是
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable的子类
D.Test类一定是继承Thread类并且实现Runnable接口
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable的子类
D.Test类一定是继承Thread类并且实现Runnable接口
如果使用Thread t=new Test()语句创建一个线程,则下列叙述正确的是
A.Test类一定要实现Runnable接口
B.Test类一定是Thread类的子类
C.Test类一定是Runnable类的子类
D. Test类一定是继承Thread类,并且实现Runnable接口
当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceof Thread的值是【 】。
当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceo Thread的值是【 】。
当使用SomeThread t=new SomeThread()创建-个线程时,下列叙述中正确的是()。
A.Some Thread类是包含run()方法的任意Java类
B.Some Thread类-定要实现Runnable接口
C.Some Thread类是Thread类的子类
D.Some Thread类是Thread类的子类并且要实现Run-nable接口
当使用SomeThread t=new SomeThread()创建一个线程时,下列叙述中正确的是()。
A.SomeThread类是包含run()方法的任意Java类
B.SomeThread类-定要实现Runnable接口
C.SomeThread类是Thread类的子类
D.SomeThread类是Thread类的子类并且要实现Run-nable接口
当使用SomeThread t=new SomeThread()创建一个线程时,下列叙述中正确的是()。
A.SomeThread类是包含run()方法的任意Java类
B.SomeThread类一定要实现Runnable接口
C.SomeThread类是Thread类的子类
D.SomeThread类是Thread类的子类并且要实现Runnable接口
A.MyThread类是包含run()方法的任意java类
B.MyThread类一定要实现Runnable接口
C.MyThread类是Thread类的子类并且要实现Runnable接口
D.MyThread类是Thread类的子类
阅读下列程序:class ThreadTest extends Thread{ public static void main(String[]args){ Thread t=new Thread(this); t.start(); } public void run(){ System.out.print("A thread test."); }} 对该程序而言,正确结论是 ()
A.该程序能够通过编译并打印输出“A thread test.”
B.该程序能够通过编译,但运行时将不调用ThreadTest类中的run()方法,因此不产生任何输出
C.该程序存在编译错误,因为在main()方法中不能使用this指针
D.上述选项都不正确
阅读下面程序 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();
阅读下面程序 public class Test implements Runnable { public static void main(String[] args) { ______ t.start(); } public void run() { System.out.println("Hello!"); } } 程序中下画线处应填入的正确选项是
A.Test t=new Test();
B.Thread t=new Thread();
C.Thread t=new Thread(new Test());
D.Test t=new Thread();
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!