Generic method to check if an array is Empty - Java Collection Framework

Java examples for Collection Framework:Array Element

Description

Generic method to check if an array is Empty

Demo Code

/*/* w w  w .  j  a  v a  2 s.c  o m*/
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */
//package com.java2s;

public class Main {
    public static <T> boolean isEmpty(T[] objects) {
        return (objects == null) || (objects.length == 0);
    }
}

Related Tutorials