public static boolean equals(String s1,String s2){
  if (s1 == s2) {
    return true;
  }
  if (s1 != null) {
    if (s2 != null) {
      return s1.equals(s2);
    }
  }
  return false;
}

public static boolean equals ( String s1 , String s2 ) { if ( s1 == s2 ) { return true ; } if ( s1 != null ) { if ( s2 != null ) { return s1 . equals ( s2 ) ; } } return false ; }
compares two strings , guarding against nulls if both strings are null we return true
