Android Collection Size Get size(Collection collection)

Here you can find the source of size(Collection collection)

Description

Get the size of specified collection.

Declaration

public static int size(Collection<?> collection) 

Method Source Code

//package com.java2s;

import java.util.Collection;

public class Main {
    /**/*w w w  .j av  a  2 s  . c  om*/
     * Get the size of specified collection.
     */
    public static int size(Collection<?> collection) {
        if (collection == null) {
            return 0;
        }
        return collection.size();
    }
}