• 2022-05-30
    读程序,控制台运行结果是 int a = 10; int b = 20; int c = a + b; int d = a - b; System.out.println("c =" + c); System.out.println("d =" + d);
  • c=30,d=-10

    内容

    • 0

      下面程序的运行结果是 ____ int x=30; int[] numbers=new int[x]; x=60; System.out.println(numbers.length);

    • 1

      请阅读下面的程序 public class Demo { public static void sum(int a, int b) { System.out.println("int:" + (a + b)); } public static void sum(int a, float b) { System.out.println("float:" + (a + b)); } public static void sum(int a, double b) { System.out.println("double:" + (a + b)); } public static void main(String[] args) { int a = 10; long b = 20; sum(a, b); } } 下列选项中,哪一个是程序的运行结果()

    • 2

      下列程序的运行结果是()。 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 ) _

    • 3

      写出以下程序的运行结果public class E4_1{ public static void main(String args&#91;&#93;) { int a = 1; int b = 2; int c = 3; a += 5; b *= 4; c += a * b; c %= 6; System.out.println("a = " + a); System.out.println("b = " + b); System.out.println("c = " + c); }}a=______ ,b=______ ,c=______ .

    • 4

      下列选项中,不能输出100个整数的是______。 A: A) for(int i=0;i<100;i++) B: System.out println(i) : C: B) int i=0: D: do E: System out.println(i) ; F: i++: G: while(i<100) ; H: C) int i=0: I: while(i<100) J: System.out.println(i) ; K: i++: L: D) int i=0; M: while(i<100) N: i++: O: if(i<100) continue; P: System.out.println(i) ;