4、下列代码的输出结果是()。public class Example{public static void main(String args[]){int a=1;int b=a++;int c=++a;System.out.println( "a=" + a);System.out.println( "b=" + b);System.out.println( "c=" + c);}}
A: a=2b=1c=3
B: a=3b=1c=2
C: a=3b=2c=3
D: a=3b=1c=3
A: a=2b=1c=3
B: a=3b=1c=2
C: a=3b=2c=3
D: a=3b=1c=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); //代码1 System.out.println("b = " + b); //代码2 System.out.println("c = " + c); //代码3 }}运行结果,代码1______ ,代码2______ ,代码3______ 。
- 以下程序的运行结果是:( )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
- 写出以下程序的运行结果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 static void main(String[] args){ int a = 7; System.out.println(a%3); } A: 2.0 B: 2 C: 1.0 D: 1
- 下列程序的运行结果是()。 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 ) _