日期:2014-05-20 浏览次数:20738 次
public static boolean arrayNullOrEmpty(byte[] objs)
{
return objs == null || objs.length == 0;
}
public static <T> boolean arrayNullOrEmpty(T[] array) {
return array == null
------解决方案--------------------
array.length == 0;
}
public static boolean arrayNullOrEmpty(Object array) {
if (array == null) {
return true;
}
if (!array.getClass().isArray()) {
throw new IllegalArgumentException("{" + array + "} is not an array!");
}
return Array.getLength(array) == 0;
}