单项选择题

下列程序运行后的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int a,b; a=0; b=0; for(int m=1;m<=10;m++) { a=a+1; b=0; for(int j=1;j<=10;j++) { a=a+1; b=b+2; } } System.out.println(a+","+B) ; } }

A.10,20
B.20,110
C.110,20
D.200,110
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: public class MethTest { static int Var1=100; int Var2=200; public static void main(String args[]) { Var1=10; MethTest Obj1=new MethTest(); MethTest Obj2=new MethTest(); Obj1.Var1 ++; System.out.println(Obj1.Var1); Obj2.Var1 ++; System.out.println(Obj2.Var1); MethTest.Var1 ++; System.out.println(Obj1.Var1); Obj1.Var2 ++; System.out.println(Obj1.Var2); 0bj2.Var2 ++; System.out.println(Obj2.Var2); } } 程序的运行结果为( )。
A.11 12 13 201 201
B.101 102 103 201 201
C.11 12 13 201 202
D.10 10 10 201 201
单项选择题
下面程序输出的结果是什么 ( ) public class Quiz2 { public static void main(String args[]) { try {throw new MyException(); }catch(Exception e) { System.out.println( It’s caught! ); }finally{ System.out.println( It’s finally caught! ); } } } class MyException extends Exception{}
A.It’s finally caught!
B.It’s caught!
C.It’s caught!/It’s finally caught!
D.无输出
相关试题
  • 下列组件中不能用addItemListener()方法...
  • 下列说法中错误的是( )。
  • 下列对于严格控制goto语句的使用理解错误的...
  • 规范化理论中消除其中多余的数据相关性是靠...
  • 以下选项中,属于合法语句的是( )。