Last active
August 29, 2015 14:14
-
-
Save czipperz/1b89192cb7f9b840f441 to your computer and use it in GitHub Desktop.
String Example
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
public static void main(String[] args) { | |
String a = "asdf"; | |
String b = "asdf"; | |
String c = b; | |
if(a == b) | |
System.out.print("AAA, "); | |
if(b == c) | |
System.out.print("BBB, "); | |
if(a == c) | |
System.out.print("CCC, "); | |
if(a.equals(b)) | |
System.out.print("aaa, "); | |
if(b.equals(c)) | |
System.out.print("bbb, "); | |
if(a.equals(c)) | |
System.out.print("ccc"); | |
//Result is AAA, BBB, CCC, aaa, bbb, ccc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment