Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * is null or its size is 0
     * 
     * <pre>
     * isEmpty(null)   =   true;
     * isEmpty({})     =   true;
     * isEmpty({1})    =   false;
     * </pre>
     * 
     * @param <V>
     * @param c
     * @return if collection is null or its size is 0, return true, else return
     *         false.
     */
    public static <V> boolean isEmpty(java.util.Collection<V> c) {
        return (c == null || c.size() == 0);
    }
}