集册 Java实例教程 检查数组是否为空的泛型方法

检查数组是否为空的泛型方法

欢马劈雪     最近更新时间:2020-01-02 10:19:05

378
检查数组是否为空的泛型方法

/*

 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.

 *

 * Copyright (c) 2014, Gluu

 */

//package com.nowjava;


public class Main {/*来 自 NowJava.com - 时代Java*/

    public static <T> boolean isEmpty(T[] objects) {

        return (objects == null) || (objects.length == 0);

    }

}