单项选择题

下面程序段的输出结果是( )。
public class Test
public static void main(String args[])
int a,b;
for(a=1,b=1;a<=100;a++)
if(b>=10)break;
if(b%2==1)
b+=2;
continue;


System.out.println(a);

A.5
B.6
C.7
D.101
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序段的输出结果为( )。 public class Test public static void main(String args[]) booleana,b,c; a=(3<5); b=(a==true); System.out.println( a= +a+ b= +b); c=(b==false); System.out.println( b= +b+ c= +c);
A.a=true b=false
b=true c=true
B.a=true b=false
b=true c=false
C.a=true b=true
b=true c=false
D.a=false b=false
b=true c=false
单项选择题
下面程序段的输出结果是( )。 class Test public static void main(String args[]) MyThread t=new MyThread(); t.displayOutput( t has been createD ); t.start(); Class MyThread extends Thread public void displayOutput(String s) System.out.println(s); public void run() displayOutput( t is running. );
A.t has been created.
B.t has been created.
T is running.
C.t is running.
D.编译出错
相关试题
  • 当使用Thread t=new Thread(r)创建一...
  • 请阅读下列程序代码,然后将程序的执行结果...
  • break语句最常见的用法是在switch语句中,...
  • FileInputStream是字节流,BufferedWriter...
  • 线程在生命周期中要经历5种状态,分别是新...