Java Array Contain arrayContains(Object[] array, Object el)

Here you can find the source of arrayContains(Object[] array, Object el)

Description

Checks to see if an array of objects contains a given element

License

Open Source License

Parameter

Parameter Description
array The array to check
el The element to look for in this array

Return

True if this array contains the element, else false.

Declaration


public static boolean arrayContains(Object[] array, Object el) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;

public class Main {
    /**//from  w  w w .j  av a 2  s  . c o  m
     * Checks to see if an array of objects contains a given element
     * 
     * @param array The array to check
     * @param el The element to look for in this array
     * 
     * @return True if this array contains the element, else false.
     * 
     */

    public static boolean arrayContains(Object[] array, Object el) {
        return Arrays.asList(array).contains(el);
    }
}

Related

  1. arrayContains(int[] array, int value)
  2. arrayContains(int[] array, int value)
  3. arrayContains(Object obj, Object[] array)
  4. arrayContains(Object[] a, Object ob)
  5. arrayContains(Object[] array, Object el)
  6. arrayContains(Object[] array, Object element)
  7. ArrayContains(Object[] array, Object obj)
  8. arrayContains(Object[] array, Object object)
  9. arrayContains(Object[] element, Object[][] array)