Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Arrays;

import java.util.Iterator;

public class Main {
    public static synchronized boolean isEqualStrings(String firstString, String secondString) {

        return isAllNull(firstString, secondString) && firstString.equalsIgnoreCase(secondString);
    }

    public static boolean isAllNull(Integer firstString, Integer secondString) {
        return firstString == null && secondString == null;
    }

    public static boolean isAllNull(String... strings) {
        if (strings == null) {
            return false;
        }
        boolean isAtleastOneStringNull = true;
        Iterator<String> stringsIterator = Arrays.asList(strings).iterator();
        while (stringsIterator.hasNext()) {
            isAtleastOneStringNull &= (stringsIterator.next() != null);
        }
        return isAtleastOneStringNull;
    }
}