Question: Given the following code: public static int indexOf(int value, int[] array) { for (int i=0; i array.length; i++) { if(array[i] = value) return i;
Given the following code: public static int indexOf(int value, int[] array) { for (int i=0; i array.length; i++) { if(array[i] = value) return i; } return -1; } What is the value of x after the following statements are executed: int[] myArray=(11,2,5,3,7,0,2}; int x; x= indexOf(8, my Array);
Step by Step Solution
3.41 Rating (160 Votes )
There are 3 Steps involved in it
The value of x after the following statements are execute... View full answer
Get step-by-step solutions from verified subject matter experts
