Periksa apakah array berisi nomor di java

public static boolean contains(final int[] arr, final int key) {
    return Arrays.stream(arr).anyMatch(i -> i == key);
}
Sore Sloth