Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    /**
     * Checks if is empty.
     *
     * @param value
     *            the value
     * @return true, if is empty
     */
    public static boolean isEmpty(Collection<?> value) {
        if (value == null)
            return true;
        return value.isEmpty();
    }

    /**
     * Checks if is empty.
     *
     * @param <T>
     *            the generic type
     * @param value
     *            the value
     * @return true, if is empty
     */
    public static <T> boolean isEmpty(T[] value) {
        if (value == null)
            return true;
        return value.length == 0;
    }
}