how to get index of array in java code example
Example 1: java indexof array
java.util.Arrays.asList(theArray).indexOf(o)
Example 2: get index of element in array java
System.out.println(new String(list).indexOf("e"));
Example 3: java array get index
public int getArrayIndex(int[] arr,int value) {
int k=0;
for(int i=0;i<arr.length;i++){
if(arr[i]==value){
k=i;
break;
}
}
return k;
}