题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-14 18:28:14

[单项选择] Public class Holt extends Thread{   Private String sThreadName;   Public static void main(String argv[]) {  Holt  h=new Holt(); h.go(); Holt(){};  Holt(String s){ sThreadName=s;  Public String getThreadName() {  return sThreadName;} }  Public void go(){  Hot first=new Hot("first"); first.start();  Hot second=new Hot("second"); second.start();  }  Public void start() {  For(int i=0;i<2;i++) {  System.out.print(getThreadName()+i); Try{  Thread.sleep(100); }catch(Exception e){  System.out.print(e.getMessage()) ;  } } }  }  当编译运行上面代码时,将会出现() 
A. 编译时错误
B. 输出first0,second0,first0,second1
C. 输出first0,first1,second10,second1
D. 运行时错误

更多"Public&ensp;class&ensp;Holt&ensp;ex"的相关试题:

[填空题]According to the functionalists, language has three functions:(),expressive, and social.
[单项选择]Which of the following does not belong to the three levels of Syntax put forward by Frantisek Danes
A. Level of the grammatical structure of sentence.
B. Level of the organization of utterance.
C. Level of the semantic structure of sentence.
D. Level of the lexical elements of sentence.
[单项选择]The survival of civilization, as we know, is()threat.
A. within
B. under
C. towards
D. upon
[单项选择]________ in a recent science competition, the three students were awarded scholarships totaling $ 21,000.
A. Judged the best
B. Judging the best
C. To be judged the best
D. Having judged the best
[单项选择]The bus stopped at the bus-stop to ______ the three men waiting there.
A. pick up
B. have up
C. take up
D. put up
[单项选择] Your application uses two threads, named threadOne and threadTwo.You need to modify the code to prevent the execution of threadOne until threadTwo completes execution. What should you do?()
A. Configure threadOne to run at a lower priority.
B. Configure threadTwo to run at a higher priority.
C. Use a WaitCallback delegate to synchronize the threads.
D. Call the Sleep method of threadOne.
E. Call the SpinLock method of threadOne.
[单项选择] public class Holt extends Thread{    private String sThreadName;  public static void main(String argv[]){         Holt h = new Holt();           h.go();       }  Holt(){}  Holt(String s){  sThreadName = s;    }  public String getThreadName(){        return sThreadName;    }  public void go(){  Holt first = new Holt("first");       first.start();  Holt second = new Holt("second");        second.start();    }  public void start(){  for(int i = 0; i < 2; i ++){  System.out.println(getThreadName() +i);            try{   Thread.sleep(100);                }   catch(InterruptedException e){  System.out.println(e.getMessage());              }            }         } }  当编译运行上面的Java代码时,将会出现()。 
A. 编译时错误
B. 输出first0, second0, first0, second1
C. 输出first0, first1, second0, second1
D. 运行时错误

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码