Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static <E> boolean isEmpty(Collection<E> collection) {
        if (collection == null || collection.isEmpty()) {
            return true;
        }
        Iterator<E> it = collection.iterator();
        while (it.hasNext()) {
            E type = (E) it.next();
            if (type != null) {
                return false;
            }
        }
        return true;
    }
}