Check, is non sorted array contain null value. - Android java.lang

Android examples for java.lang:array

Description

Check, is non sorted array contain null value.

Demo Code


//package com.book2s;

public class Main {
    /**/* w  w w. j  a  v a2s.c o m*/
     * Check, is non sorted array contain null value.
     * 
     * @param src
     * @return true if array has null value
     */
    public static <T> boolean containNull(T src[]) {
        for (T item : src) {
            if (item == null) {
                return true;
            }
        }

        return false;
    }
}

Related Tutorials