Given the code fragment:
What is the result?
Correct Answer:
D
🗳️
The length of the element with index 0, {0, 1, 2}, is 3. Output: 3
The element with index 1, {3, 4, 5, 6}, is of type array. Output: true
The element with index 0, {0, 1, 2} has the element with index 1: 1. Output: 1
View the exhibit:
Given:
What is the result when this program is executed?
Correct Answer:
B
🗳️
After the statement jian = bob; the jian will reference the same object as bob.
Given the code fragment:
What is the result?
Correct Answer:
C
🗳️
In segment 'if (valid)' valid must be of type boolean, but it is a string.
This makes the compilation fail.
Given:
What is the result?
Correct Answer:
A
🗳️
Within main z is assigned 6. z is printed. Output: 6
Within doStuff z is assigned 5.DoStuff2 locally sets z to 4 (but MyScope.z is set to 4), but in Dostuff z is still 5. z is printed. Output: 5
Again z is printed within main (with local z set to 6). Output: 6
Finally MyScope.z is printed. MyScope.z has been set to 4 within doStuff2(). Output: 4
Which two are valid instantiations and initializations of a multi dimensional array?
Correct Answer:
AD
🗳️