• 2022-06-08
    请阅读下面的程序 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
  • D

    内容

    • 0

      中国大学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”) ; } }

    • 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

      请阅读下列的程序 public class Example01 { public static void main(String args) { int num = 127; byte b = num; System.out.println(b); } } 程序的运行结果是( )

    • 4

      请阅读下面的程序 public class Example { public static void main(String args) { int x = 1; do { x++; } while (x &lt;= 4); System.out.println("x = " + x); } } 运行程序后,下列选项中,哪一个是x的值。( ) A: 3 B: 4 C: 5 D: 6