What is the output of the following fragment?int i = 1;int j = 1;while (i < 5) {i++;j = j * 2;} System.out.println(j);
查看答案
How many times will the following code print "Welcome to Java"?int count = 0;while (count++ < 10) {System.out.println("Welcome to Java");}
A. 9
B. 0
C. 10
D. 11
How many times will the following code print "Welcome to Java"?int count = 0;do {System.out.println("Welcome to Java");} while (++count < 10);
A. 10
B. 9
C. 11
D. 0
What is the value in count after the following loop is executed?int count = 0;do {System.out.println("Welcome to Java");} while (count++ < 9);System.out.println(count);
A. 0
B. 8
C. 9
D. 10
The while loop and the do-while loop are equivalent in their expressive power; in other words, you can rewrite a while loop using a do loop, and vice versa.
A. false
B. true