Check if value exists in a multidimensional array java
问题 Without a for loop , is there any way to see if a value exists in a multidimensional array ? I found Arrays.asList(*ArrayName*).contains(*itemToFind*) but that will only search the first dimension of the array, and I need to search 2 dimensions. 回答1: I created an 5x5 Integer array and intialized with value i*j. Exists method takes a row number and value to search for. private static Integer[][] myarray = new Integer[5][5]; public static boolean exists(int row, int value) { if(row >= myarray