count目前的值是1,请问执行复合赋值语句 count += 1 后,count的值是多少?
A: 0
B: 1
C: 2
D: 3
A: 0
B: 1
C: 2
D: 3
举一反三
- 阅读以下程序public class Count{static int count;int number;public Count(){count = count + 1;number = count;}}class Test{public static void Main(){Count a = new Count();Count b = new Count();Count c = new Count();}}程序运行后,对象a的count值是() A: 0 B: 1 C: 2 D: 3
- 下面的代码段执行之后count的值是什么( ) int count = 1; for (int i = 1; i <= 5; i++) { count += i; } System.out.println(count);
- 下面的代码段执行之后count的值是什么( ) int count = 1; for(int i = 1; i <= 5; i++) { count+= i; } System.out.println(count); int count = 1; for(int i = 1; i <= 5; i++) { count+= i; } System.out.println(count);
- 使用while 语句实现打印出1至10.count = 1while ( ) print (count) count = count + 1 A: count B: True C: count D: count
- for(count = 1;sum=0; count <=10; count++)是正确的for语句