fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[] args) {
  11. callMethod();
  12. callMethod();
  13. callMethod();
  14. callMethod();
  15. callMethod();
  16. callMethod();
  17. callMethod();
  18. }
  19.  
  20. private static void callMethod() {
  21. char[] cj1={'A','B','C','D'};
  22. String sj1 = new String(cj1);
  23. sj1.intern();
  24. String sc1="ABCD";
  25. System.out.println(sj1==sc1);//true
  26. }
  27. }
Success #stdin #stdout 0.06s 27744KB
stdin
Standard input is empty
stdout
true
false
false
false
false
false
false