public class MainClass { public static void main(String[] argv) { String s1 = "Compare me"; String s2 = "Compare me"; if (s1 == s2) { System.out.println("=="); } } } //== test is true because s2 refers to the String in the pool that was created for s1.