Java Collection Size size(Collection coll)

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

Description

size

License

Open Source License

Declaration

public static int size(Collection<?> coll) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static int size(Collection<?> coll) {
        if (isNull(coll)) {
            return 0;
        }//from w  w  w .j a va 2 s . c o  m
        return coll.size();
    }

    public static int size(Object[] arr) {
        if (isNull(arr)) {
            return 0;
        }
        return arr.length;
    }

    public static boolean isNull(Object obj) {
        return null == obj;
    }
}

Related

  1. size(Collection... collections)
  2. size(Collection collection)
  3. size(Collection c)
  4. size(Collection c)
  5. size(Collection col)
  6. size(Collection collection)
  7. size(Collection values)
  8. size(Collection v)
  9. size(final Collection collection)