Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.lang.reflect.Array;

public class Main {

    public static boolean isEmptyArray(Object arrayObj) {
        if (null == arrayObj) {
            return true;
        }

        Class clazz = arrayObj.getClass();

        if (!clazz.isArray()) {
            return true;
        }

        if (Array.getLength(arrayObj) == 0) {
            return true;
        }

        return false;
    }
}