Android examples for java.util:List
Is this list empty.
//package com.java2s; import java.util.Collection; public class Main { /**/*from w w w .j a va 2s. c o m*/ * Is this list empty. Checks for null as well as size. * * @return true if empty, false if not */ public static boolean isEmpty(Collection collection) { return collection == null || collection.isEmpty(); } /** * Is this list empty. Checks for null as well as size. * * @return true if empty, false if not */ public static boolean isEmpty(Object[] collection) { return collection == null || collection.length == 0; } }