check Collection Emptiness - Android java.util

Android examples for java.util:Collection

Description

check Collection Emptiness

Demo Code


//package com.java2s;

import java.util.Collection;

public class Main {
    public static boolean checkCollectionEmptiness(Collection collection) {
        if (collection == null || collection.size() < 1)
            return true;
        else//from  w  ww.j a  va 2  s.  c  o m
            return false;
    }

    public static boolean checkCollectionEmptiness(Object[] collection) {
        if (collection == null || collection.length < 1)
            return true;
        else
            return false;
    }
}

Related Tutorials