Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static boolean isNullOrEmpty(String str) {
        return (str == null || str.length() == 0);
    }

    public static boolean isNullOrEmpty(final Object str) {
        return (str == null || str.toString().length() == 0);
    }

    public static boolean isNullOrEmpty(final String... strs) {
        if (strs == null || strs.length == 0) {
            return true;
        }
        for (String str : strs) {
            if (str == null || str.length() == 0) {
                return true;
            }
        }
        return false;
    }
}