Skip to content

Instantly share code, notes, and snippets.

@MrRahulR
Created June 5, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrRahulR/b15182e2ca82b5d550a1eda51afaaf90 to your computer and use it in GitHub Desktop.
Save MrRahulR/b15182e2ca82b5d550a1eda51afaaf90 to your computer and use it in GitHub Desktop.
StringEquals
public class StringEquals {
public static void main(String[] args) {
String string1 = "Hello ";
String string2 = "hello ";
String string3 = "Hello ";
System.out.println(string1.equals(string2)); // returns false
System.out.println(string1.equals(string3)); // returns true
}
}
/*
Output :
false
true
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment