Java String Equal areEqual(String s1, String s2)

Here you can find the source of areEqual(String s1, String s2)

Description

are Equal

License

Open Source License

Declaration

public static boolean areEqual(String s1, String s2) 

Method Source Code

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

public class Main {
    public static boolean areEqual(String s1, String s2) {
        if (s1 == null && s2 == null) {
            return true; // ????
        } else if (s1 == null && s2 != null) {
            return false;
            // } else if(s1 != null && s2 == null) {
            //     return false;
        } else {//w ww.  j  a  va  2s . c o  m
            return s1.equals(s2);
        }
    }
}

Related

  1. areEqual(String expected, String actual)
  2. areEqual(String s1, String s2)
  3. areEqual(String s1, String s2)
  4. areEqual(String seq1, String seq2)
  5. areEqual(String str1, String str2)
  6. areEqual(String string1, String string2)