//package com.nowjava;/** 时代Java公众号 - N o w J a v a . c o m 提供 **/
public class Main {
public static void main(String[] argv) {
Object[] entities = new String[] { "1", "abc", "level", null,
"nowjava.com", "asdf 123" };
System.out.println(getSizeFromArray(entities));
}
/** Get size from an array entities.
*
* @param entities to get its size.
* @return entities size.
*/
public static Integer getSizeFromArray(Object[] entities) {
return isNotEmpty(entities) ? entities.length : 0;
}
/** Test if entities array is not empty.
*
* @param entities to test if is not empty.
* @return true if entities is not null and its length is more than zero.
*/
public static boolean isNotEmpty(Object[] entities) {
return !isEmpty(entities);
/**
from
* n o w j a v a . c o m - 时 代 Java
**/
}
/** Test if entities array is empty.
*
* @param entities to test if it is empty.
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。