Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    /**
     * Returns true if the collection is null or 0-length.
     *
     * @param collection the collection to be examined
     * @return true if str collection null or zero length
     */
    public static boolean isEmpty(Collection<?> collection) {
        if (collection == null || collection.isEmpty() || collection.size() == 0) {
            return true;
        } else {
            return false;
        }
    }
}