Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Collection;

public class Main {
    /**
     * Check if the collection is empty
     * 
     * @param c The collection to check.
     * @return False if the collection is not null and contains at least one element. True if the collection
     * is null, or if the collection is empty.
     */
    public static boolean isEmpty(Collection<?> c) {
        if (c != null && c.size() > 0) {
            return false;
        }
        return true;
    }
}