check if a long[] array contains a long - Android java.lang

Android examples for java.lang:array contain

Description

check if a long[] array contains a long

Demo Code


//package com.java2s;

public class Main {
    public static boolean contains(final long[] array, final long value) {
        if (array == null)
            return false;
        for (final long item : array) {
            if (item == value)
                return true;
        }/*from   w ww.  j  a  v  a  2 s  .  c  om*/
        return false;
    }
}

Related Tutorials