SyntaxFix
Write A Post
Hire A Developer
Questions
Here is Java 8 solution
public static boolean contains(final int[] arr, final int key) { return Arrays.stream(arr).anyMatch(i -> i == key); }