相关题目
阅读下列程序
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;
}
}
}
下列对程序运行结果描述的选项中,正确的是:
下列表达式中,类型可以作为int型的是:
下列语句中,可以作为无限循环语句的是:
下列运算结果为1的是:
下列运算符中,优先级最高的是:
AWT中用来表示对话框的类是:
点击窗口内的按钮时,产生的事件是:
用于设置组件大小的方法是:
如果线程调用下列方法,不能保证使该线程停止运行的是:
阅读下列代码段
class Test implements Runnable {
public int run( ) {
int i = 0;
while (true) {
i++;
System.out.println ("i="+i);
}
}
}
上述代码的编译结果是:
