What is stored by a reference variable?What would be the results after the following code was executed? int[] array1 = {10, 20,
30, 40}; int [] array2 = {20, 30, 50, 60}; array1 = array2; array2 = array1;
1 answer:
Answer:
Both array1 and array2 would be pointing to the array with {20,30,50,60}.
Explanation:
array1 and array2 are references (pointers) to the array.
array1 = array2; only makes the array1 variable point to the same destination as the array2 variable.
The next assignment array2 = array1; therefore doesn't change anything. array2 was already pointing to this location.
You might be interested in
Answer:
Power lines
Explanation:
Because their everywhere
And what is the question?
Answer:
Fill the slides with images and animations
Explanation:
these will most likely distract the audience