Answers for "array indexing java"

32

how to create an array in java

int[] array1 = new int[5]; //int array length 5
String[] array2 = new String[5] //String array length 5
double[] array3 = new double[5] // Double array length 5
Posted by: Guest on January-28-2020
2

java indexof array

java.util.Arrays.asList(theArray).indexOf(o)
Posted by: Guest on March-18-2020
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"

Java Answers by Framework

Browse Popular Code Answers by Language