举一反三
- 请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x >; 5) { System.out.println("a"); } else { System.out.println("b"); } }} 程序的运行结果是() A: true B: false C: a D: b
- 请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x > 5) { System.out.println("a"); } else { System.out.println("b"); } }} 程序的运行结果是() A: true B: false C: a D: b
- 请阅读下面的程序 public class Example { public static void main(String[] args) { int x = 1; do { x++; } while (x <= 4); System.out.println("x = " + x); } } 程序的运行结果是()
- 请阅读下面的程序,选择正确的运行结果。class Demo{private static int x ;public static void main(String[] args){System.out.println(x++);}}
- 中国大学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”) ; } }
内容
- 0
请阅读下面的程序public class Example {public static void main(String[] args) {int x = 1;do {x++;} while (x <= 4);System.out.println("x = " + x);}}程序的运行结果是( ) A: x=3 B: x=5 C: x=6 D: x=4
- 1
(2-6)请写出下面程序运行结果。 public class Demo { public static void main(String[] args) { int b = 011001; System.out.println(b); } }
- 2
请阅读下面的程序 public class Example { public static void main(String args) { int x = 1; do { x++; } while (x <;= 4); System.out.println("x = " + x); } } 运行程序后,下列选项中,哪一个是x的值。( ) A: 3 B: 4 C: 5 D: 6
- 3
(2-5)写出下面程序运行结果。 public class Demo { public static void main(String args[]) { System.out.println(123); System.out.println(0123); System.out.println(0x123); } }
- 4
下列程序的运行结果? public class Test { public static void main(String a[]) { int x=3,y=4,z=5; if (x>3) { if (y<2) System.out.println("show one"); else System.out.println("show two"); } else { if (z>4) System.out.println("show three"); else System.out.println("show four"); } } }