Check if long array contains a long value - Android java.lang

Android examples for java.lang:array

Description

Check if long array contains a long value

Demo Code


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;
        }// w  w w  . jav  a  2  s  .co  m
        return false;
    }

}

Related Tutorials