单选题
阅读下列程序
阅读下列程序
public class Test implements Runnable{
private int x=0;
private int y=o;
boolean flag=true;
public static void main(string[ ] args) {
Test r =new Test( );
Thead t1=new Thead(r);
Thead t2=new Thead(r);
t1.start( );
t2.start( );
}
public void run(){
while(flag) {
x++;
y++;
System.out.println("(" +x_ ","+y+")");
if (x>=10)
flag=false;
}
}
}
下列对程序运行结果描述的选项中,正确的是:
A
每行的(x,y)中,可能有;每一对(x,y)值都出现两次。
B
每行的(x,y)中,可能有;每一对(x,y)值仅出现一次。
C
每行的(x,y)中,可能有x=y;每一对(x,y)值都出现两次。
D
每行的(x,y)中,可能有x=y;每一对(x,y)值都出现一次。
答案解析
正确答案:B
题目纠错
