以下代码的调试结果为?1: public class Q102: {3: public static void main(String[] args)4: {5: int i = 10;6: int j = 10;7: boolean b = false;8:9: if( b = i == j)10: System.out.println("True");11: else12: System.out.println("False");13: }14: }
举一反三
- 下列程序的运行结果是()。 public class Test public static void main ( String [ ] args ) int count = 0 for( int i = 1 i < 5 i = 2) for( int j = 1 j< = 10 j = 3) count System .out .print (count ) _
- 以下程序调试结果 public class test { public static void main(String args[]) { int i=1, j=3; while (j>0) { j--; i++; } System.out.println(i); } }
- 以下代码的输出结果为( ) public class Pass{ static int j = 20; public void amethod(int x){ x = x*2; j = j*2; } public static void main(String args[]){ int i = 10; Pass p = new Pass(); p.amethod(i); System.out.println(i+" and "+j); } }
- 下列语句执行后,i的值是( )。 public class Test { public static void main(String[ ] args) { int i =0; for(int j=10; j>5&&i<5; j-=3,i+=2) i=i+j; System. out. println(i); } } A: 8 B: 9 C: 10 D: 12
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }