Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {

    public static int size(Collection<?> collection) {
        return (collection == null ? 0 : collection.size());
    }

    public static int size(Collection<?>... collections) {
        int size = 0;
        if (collections != null) {
            for (Collection<?> c : collections) {
                if (c != null) {
                    size += c.size();
                }
            }
        }

        return size;
    }
}