public class Holt extends Thread{    private Strin...
单选题

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代码时,将会出现()。 

发布日期:2020-04-10

A.编译时错误

B.输出first0, second0, first0, second1

C.输出first0, first1, second0, second1

D.运行时错误

热门试题

热门资讯

    暂无相关推荐~

分享给好友

分享到朋友圈

取消

使用浏览器的分享功能,把这篇文章分享出去

确定