首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceof Thread的值是【 】。

当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceof Thread的值是【 】。

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“当使用Thread t=new Thread(r)创建一个线…”相关的问题
第1题
当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceo Thread的值是【 】。

当使用Thread t=new Thread(r)创建一个线程时,表达式:r instanceo Thread的值是【 】。

点击查看答案
第2题
下面程序的功能在监控台上每隔一秒钟显示一个字符串"Hello!"。public class Class31

下面程序的功能在监控台上每隔一秒钟显示一个字符串"Hello!"。

public class Class31 implements Runnable

{

public static void main(String args[])

{

Class31 t=new Class31();

Thread tt=new Thread(t);

tt.start();

}

public void run()

{

for(;;)

{

try{

();

}catch(()){}

System.out.println("Hello");

}

}

}

点击查看答案
第3题
运行下列程序,会产生什么结果? () public class X exlends Thread implements Runable

运行下列程序,会产生什么结果? () public class X exlends Thread implements Runable{ public void run(){ System.out.println("this is run()"); } public static void main(String args[]) Thread t=new Thread(new X()); t.start(); } }

A.第一行会产生编译错误

B.第五行会产生编译错误

C.第六行会产生运行错误

D.程序会运行和启动

点击查看答案
第4题
下列程序的功能是创建了一个显示5个"Hello!"的线程并启动运行,请将程序补充完整。 public cl
ass ThreadTest extends Thread{ public static void main(String args[ ]){ ThreadTest t = new【 】; t.start(); } public void run(){ int i =0; while(true){ System.out.println("Hello!"); if(i++==4) break; } } }

点击查看答案
第5题
下列程序的功能是创建了一个实现5个“Hello!”的线程并启动运行,请将程序补充完整。 public class
Test extends Thread{ public static void main(String[ ] args){ Test t = new 【 】 ; t.start(); public void run() int i = 0; while (true) System.out.println("Hello" ); if (i++ ==4) break; } }

点击查看答案
第6题
1下列程序的功能是创建了一个显示5个“Hello!”的线程并启动运行,请将程序补充完整。 public class
ThreadTest extends Thread{ public static void main(String args[ ]){ ThreadTest t=new【 】; t.start(); } public void run() { int i =0; while(true){ System.out.println("Hello!"); if(i++==4) break; }}}

点击查看答案
第7题
听力原文:M: Oh, my shirt sleeve. Must have gotten caught on that nail.W: Here, let me take

听力原文:M: Oh, my shirt sleeve. Must have gotten caught on that nail.

W: Here, let me take a look.

M: What do you think of it?

W: Hmm with a needle and thread, this can be mended and look just like new.

What does the woman think about the shirt?

A.The man will have to buy a new shirt.

B.The shirt looks just like the man's new one.

C.The shirt can be repaired easily.

D.The man shouldn't put sharp objects in his shirt pocket.

点击查看答案
第8题
通过实现Runnable接口创建线程,请在画线处加入正确的代码完成此程序【 】。 public class Thre
adTest { public static void main(String args[ ]) { Thread t1=new Thread(new Hello()); Thread t2=new Thread(new Hello()); ______; t2.start(); } } class Hello implements Runnable { int i; public void run() { while(true) { System.out.println("Hello"+i++); if(i==5) break; } } }

点击查看答案
第9题
运行下列程序,会产生什么结果()?Public cclass My Thread extends Thread implements Runnable
运行下列程序,会产生什么结果()?

Public cclass My Thread extends Thread implements Runnable{

Public void run(){

}

Public static void main(String[]args){

Threadt=new Thread(new My Thread());

t.start();

}

}

A.第一行会产生编译错误

B.第六行会产生编译错误

C.第六行会产生运行错误

D.程序会运行和启动

点击查看答案
第10题
"如下代码创建一个新线程并启动线程:Runnable target=new MyRunnable();Thread myThread=new Thread(target);问:如下哪些类可以创建target对象,并能编译正确

A.public class MyRunnable extends Runnable{public void run(){}}

B.public class MyRunnable extends Object{public void run(){}}

C.public class MyRunnable implements Runnable{public void run(){}}

D.public class MyRunnable extends Runnable{void run(){}}

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改