Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

find if a value is in a 2d array java

public boolean findValue (int[][]arr, int value)
    for(int i=0; i<arr.length;i++)
    {
        for(int j=0; j<arr.length;j++)
        {
            if(arr[i][j]==value)
                return true;
        }
    }
    return false;
}
 
PREVIOUS NEXT
Tagged: #find #array #java
ADD COMMENT
Topic
Name
8+1 =