编译和运行下面代码时显示的结果是( ) 。
public class Tux extends Thread{
static String sName = "vandeleur";
public static void main(String argv[]){
Tux t = new Tux();
t.piggy(sName);
System.out.println(sName);
}
public void piggy(String sName){
sName = sName + " wiggy";
start();
}
public void run(){
for(int i=0;i < 4; i++){
sName = sName + " " + i;
}
}
}
A、编译错误
B、vandeleur
C、vandeleur 0
D、vandeleur wiggy 0 1 2 3 |
|