以下程序的运行结果是:( )public class Increment{ public static void main(String args[]){ int c; c = 2; System.out.println(c); System.out.println(c++); System.out.println(c); } }
A: 2 2 2
B: 2 3 3
C: 2 2 3
D: 3 4 4
A: 2 2 2
B: 2 3 3
C: 2 2 3
D: 3 4 4
举一反三
- 以下程序的运行结果是:( ) public class Increment{ public static void main(String args[]){ int c; c = 2; System.out.println(c); System.out.println(c++); System.out.println(c); } }
- 阅读下面代码: public class Test2005 { public static void main(String args[]) { System.out.println((3>2) 4:5); } } 其运行结果是 A: 2 B: 3 C: 4 D: 5
- public class Ex36{ public static void main(String args[]){ System.out.println((3>2)?4:5); } } 阅读上列代码,其运行结果是________。( ) A: 5 B: 2 C: 4 D: 3
- 写出以下程序的运行结果public class E4_1{ public static void main(String args[]) { 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=______ .
- public class E4_1{ public static void main(String args[]) { int a = 1; int b = 2; int c = 3; a += 5; b *= 4; c += a * b; c %= 6; System.out.println("a = " + a); //代码1 System.out.println("b = " + b); //代码2 System.out.println("c = " + c); //代码3 }}运行结果,代码1______ ,代码2______ ,代码3______ 。