Java String Equal areEquals(final String s1, final String s2)

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

Description

Compare two String to see if they are equals (both null is ok).

License

Apache License

Parameter

Parameter Description
s1 string
s2 string

Return

if two String are equals

Declaration

public static boolean areEquals(final String s1, final String s2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from  w w  w .  j ava  2  s. co m
     * Compare two String to see if they are equals (both null is ok).
     *
     * @param s1 string
     * @param s2 string
     * @return if two String are equals
     */
    public static boolean areEquals(final String s1, final String s2) {
        return s1 == null ? s2 == null : s1.equals(s2);
    }
}

Related

  1. areEqualConstantTime(String a, String b)
  2. areEqualIgnoreCase(String s1, String s2)
  3. areEqualIgnoreNull(String value1, String value2, boolean caseSensitive)
  4. areEqualLexemes(String l1, String l2)
  5. areEquals(final String origin, final String checkWith)
  6. areEqualsIgnoreCaseAndTrim(final String s1, final String s2)
  7. areEqualXMLValues(String s1, String s2)
  8. areStringEquals(String s1, String s2)
  9. areStringEquals(String string1, String string2)