Here you can find the source of arrayHasElements(Object[] obj)
public static boolean arrayHasElements(Object[] obj)
//package com.java2s; //License from project: Apache License public class Main { public static boolean arrayHasElements(Object[] obj) { if (obj != null && obj.length != 0) { for (Object object : obj) { if (object != null) { return true; }// w w w. j a v a2 s . c om } } return false; } }