Arrays 3
You have an int array variable scores of unknown length. Complete the statement to print the first element of the array (that is, the element at index 0). You can assume the scores is not null. System.out.println( ____________________ ); |
scores[0] | |
What is printed by this segment of code?
int[] temperatures = {65, 71, 68, 85, 87, 89, 78};
int[] dailyTemps = temperatures;
dailyTemps[6] = 101;
System.out.println(temperatures[6]); |
101 | |
What is printed by this segment of code
int[] temperatures = {65, 71, 68, 85, 87, 89, 78};
int[] dailyTemps = Arrays.copyOf(temperatures, temperatures.length);
dailyTemps[6] = 101;
System.out.println(temperatures[6]);
|
78 |