Here you can find the source of arrayContainsNumber(Number[] array, Number number)
Parameter | Description |
---|---|
array | The array to check |
number | The number to find |
static boolean arrayContainsNumber(Number[] array, Number number)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { /**/* w w w .j a va2s . co m*/ * Returns whether or not the given array contains the given number. * * @param array The array to check * @param number The number to find * @return The result */ static boolean arrayContainsNumber(Number[] array, Number number) { return Arrays.stream(array).filter(item -> item != null && item.equals(number)).count() > 0; } }