Created
February 23, 2021 09:50
-
-
Save learnit-codeit/8773d044ac20a29ccf3a88f3bb961234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String str1 = "Hello"; | |
String str2 = "Hello"; | |
StringBuffer buffer1 = new StringBuffer("hello"); | |
StringBuffer buffer2 = new StringBuffer("hello"); | |
System.out.println(str1.equals(str2));//this return true | |
System.out.println(buffer1.equals(buffer2));//this return false. Because StringBuffer not override the equals method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment