Question: Consider the following method. public static void changeArrays ( int [ ] arr 1 , int [ ] arr 2 ) { arr 1 =

Consider the following method.
public static void changeArrays(int[] arr1, int[] arr2){ arr1= arr2;
arr1[3]=3; }
What are the values of a and b after running the following code?
int[] a ={1,2,3,4,5}; int[] b ={6,7,8,9,10}; changeArrays(a, b);
ab
(A){1,2,3,4,5}(B){1,2,3,4,5}(C){6,7,3,9,10}(D){6,7,8,3,10}(E){6,7,8,3,10}
{6,7,8,3,10}{6,7,8,9,10}{6,7,8,9,10}{6,7,8,3,10}{6,7,8,9,10}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!