欢迎来到PP题库网 PP题库官网
logo
全部科目 > java工程师信产部认证考试

单项选择题

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.运行时错误

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题