• 2022-06-08
    请阅读下面的程序 public class Example { public static void main(String[] args) { int x = 1; do { x++; } while (x <= 4); System.out.println("x = " + x); } } 运行程序后,下列选项中,哪一个是x的值
  • 5

    内容

    • 0

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

    • 1

      阅读下面的程序 public class Test { public static void main(String&#91;&#93; args) { for(int x = 0 ; x <=3 ; x++){ continue; System.out.print(x%2); } } }

    • 2

      请阅读下面的程序 public class Example03 { public static void main(String args) { int x = 3; if (x > 5) { System.out.println("a"); } else { System.out.println("b"); } } } 程序的运行结果是()

    • 3

      请阅读下面的程序 public class Test { public static void main(String[] args) { int x; int y; for (x = 1, y = 1; x <= 100; x++) { if (y >= 20) { break; } if (y % 3 == 1) { y += 3; continue; } y -= 5; } System.out.println(“x=” + x + “,y=” + y); } } 下列选项中,哪一个是程序的运行结果( )

    • 4

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