• 2021-04-14
    请阅读下面的程序 public class Example { public static void main(String[] args) { int x = 1; do { x++; } while (x <= 4); System.out.println("x = " + x); } } 程序的运行结果是()
  • 5

    内容

    • 0

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

    • 1

      请阅读下面的程序,选择正确的运行结果。class Demo{private static int x ;public static void main(String[] args){System.out.println(x++);}}

    • 2

      以下程序运行结果是 public class Test { public static void main(String[] args) { int a=1,b[]={2}; add(a); add(b); System.out.println(a+","+b[0]); } static int add(int x){ x++; return x; } static void add(int[] x){ x[0]++; } }

    • 3

      请阅读下面的程序 public class Test { public static void main(String[] args) { for(int x = 0 ; x <=3 ; x++){ continue; System.out.print(x%2+” “); } } } 下列选项中,哪一个是程序的运行结果

    • 4

      请阅读下面的程序 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