how to check if in array java

Java
for (int element : arr) {
    if (element == toCheckValue) {
        return true;
    }
}

Source

Also in Java: