Java Utililty Methods Array Contain

List of utility methods to do Array Contain

Description

The list of methods to do Array Contain are organized into topic(s).

Method

booleanarrayContains(int[] arr, int e)
checks if an int array contains an int element
for (int i = 0; i < arr.length; i++) {
    if (arr[i] == e)
        return true;
return false;
booleanarrayContains(int[] arr, int ii)
array Contains
boolean result = false;
for (int i = 0; i < arr.length; i++) {
    if (arr[i] == ii)
        result = true;
return result;
intarrayContains(int[] array, int value)
array Contains
int index = 0;
for (; index < array.length; index++)
    if (array[index] == value)
        break;
if (index < array.length)
    return index;
else
    return -1;
...
booleanarrayContains(int[] array, int value)
array Contains
for (int i : array) {
    if (i == value) {
        return true;
return false;
booleanarrayContains(Object obj, Object[] array)
array Contains
for (int i = 0; i < array.length; ++i) {
    if (array[i].equals(obj)) {
        return true;
return false;
intarrayContains(Object[] a, Object ob)
Returns the index of ob in array a
if (a == null)
    return -1;
for (int i = 0; i < a.length; i++) {
    if (a[i] == ob)
        return i;
return -1;
booleanarrayContains(Object[] array, Object el)
Checks to see if an array of objects contains a given element
return Arrays.asList(array).contains(el);
booleanarrayContains(Object[] array, Object el)
array Contains
return Arrays.asList(array).contains(el);
booleanarrayContains(Object[] array, Object element)
Check if an unsorted array contains an element.
return arrayContains(array, element, false);
booleanArrayContains(Object[] array, Object obj)
This methode returns, if array contains obj.
for (int i = 0; i < array.length; i++) {
    if (array[i].equals(obj)) {
        return true;
return false;