What is the output of the following code?
```
int x = 0;
while (x < 4) {
x = x + 1;
}
System.out.println("x is " + x);
```
a. x is 0
b. x is 1
c. x is 2
d. x is 3
e. x is 4
e. x is 4
x is 0 before the loop. The loop is executed 4 times for x from 0 to 3. When x is 4 the loop exits. So, the correct answer is E.
You might also like to view...
MC A module function is called by preceding the function name with the module name followed by the______symbol.
a) .. b) ->. c) :. d) ( ).
___________ affects the sequence of bytes in State but does not alter byte contents and does not depend on byte contents to perform its transformation.
Fill in the blank(s) with the appropriate word(s).
A transparent bridge creates the internal port table by using a form of ____.?
A. ?forward learning B. ?backward correction C. ?backward learning D. ?forward correction
What class do you use if you have a group of user settings and you want to create a simple way in which the user can edit them?
a. The PreferenceEdit class b. The PreferenceActivity class c. The PreferenceAccess class d. The PreferenceIntent class