Answers for "java array get element by index"

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 "java array get element by index"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language