Skip to content

Instantly share code, notes, and snippets.

@gauravkukade
Created December 21, 2019 04:16
Show Gist options
  • Save gauravkukade/0e6334c5ae880cf731d292ab6abaf6b5 to your computer and use it in GitHub Desktop.
Save gauravkukade/0e6334c5ae880cf731d292ab6abaf6b5 to your computer and use it in GitHub Desktop.
equals() method of the String class in Java https://coderolls.com/compare-strings-in-java/
public boolean equals(Object anObject)
It compare this string with the argument strings and return true if the argument is not null and contains the same character as the specified string.
param -
another string
returns -
true - if argument is not null and it contains same characters as the specified string
false - if the argument is null or it does not contain same characters as the specified string
ex. firstString.equals(secondString)
// returns true if and only if the secondString is not null and contains the same characters as firstString.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment