Question: Assuming the 1-Dimensional array named a of the previous question was created and did in fact, contain 5, 12, -4, and 17 at indices 0,
Assuming the 1-Dimensional array named a of the previous question was created and did in fact, contain 5, 12, -4, and 17 at indices 0, 1, 2, and 3 respectively. The following code segment produces 3 lines of output where each line will display Line #:(# means a 1., 2. or 3 for a given line of output) an int, an ampersand "&", and an int. Below the code segment the output of the Strings is shown, but the ints are not. Fill in the blanks with the correct int values: 4. // the array named a ls created // here and contains (5, 12,-4, 17) int c= 3; int d = 2; changelc,d); System.out.println("Line 1:"+C+"&"+d); change(ac), al d ); System.out.println("Line 2:" + a[c]+"&*+al d D): change(a,c,d); System.out.println("Line 3:"+al c14"&"+al d 1): 3 public static void change(int a, int b) int temp = a: a = b; b = temp: 3 public static void change(int[] data, inta, int b) int temp - datal al: datal al-datab: data bl-temp: Line 1: S Line 2: Line 3: &
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
