Answers for "array get index of value java"

1

how to get array index value into variable in java

String zz = aa[5];
Posted by: Guest on March-31-2021
0

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;
}
Posted by: Guest on February-07-2021

Code answers related to "array get index of value java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language