Here you can find the source of inArray(final T[] array, final U search)
Parameter | Description |
---|---|
array | The array to search through. |
search | The object to search for in the array. |
public static <T, U extends T> boolean inArray(final T[] array, final U search)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .j a v a 2 s. c o m*/ * Check whether the given array contains the given search object. * * @param array The array to search through. * @param search The object to search for in the array. * * @return {@code true} if the search object was found in the array. */ public static <T, U extends T> boolean inArray(final T[] array, final U search) { for (final T element : array) if (search.equals(element)) return true; return false; } }