fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String a = "xyz", b = "xyz";
  9. System.out.printf("a == b: %s\n", a == b);
  10. String c = new String("xyz"), d = new String("xyz");
  11. System.out.printf("c == d: %s\n", c == d);
  12. }
  13. }
Success #stdin #stdout 0.05s 213440KB
stdin
Standard input is empty
stdout
a == b: true
c == d: false