What is the value of a[1] after the following code is executed?int[] a = {0, 2, 4, 1, 3};for(int i = 0; i < a.length; i++)a[i] = a[(a[i] + 3) % a.length];
A). 0
B). 1
C). 2
D). 3
E). 4
1
when i = 0;
a[i] = a[(a[i]+3)%a.length] //a.length =5;
a[0] = a[(a[0]+3)%5];
a[0] = a[(0+3)%5] ; // 3
a[0] = a[3] = 1
when i = 1;
a[1]=a[(a[1]+3)%5];
a[1]=a[(2+3)%5];
a[1]=a[0];
a[1]=1;
Therefore a[1] is equal to 1
4. Which one of the following is a valid statement?
8. When you pass an array to a method, the method receives ________ .
9. Analyze the following code and choose the correct answer.int[] arr = new int[5];arr = new int[6];
10. Which will legally declare, construct, and initialize an array?