java indexof array
java.util.Arrays.asList(theArray).indexOf(o)
java indexof array
java.util.Arrays.asList(theArray).indexOf(o)
how to print the index of an array in java
public class PrintArray {
public static void main(String[] args) {
//Initialize array
int [] arr = new int [] {1, 2, 3, 4, 5};
System.out.println("Elements of given array: ");
//Loop through the array by incrementing value of i
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i] + " ");
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us