Skip to content

Instantly share code, notes, and snippets.

@czipperz
Last active August 29, 2015 14:14
Show Gist options
  • Save czipperz/1b89192cb7f9b840f441 to your computer and use it in GitHub Desktop.
Save czipperz/1b89192cb7f9b840f441 to your computer and use it in GitHub Desktop.
String Example
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