// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Eq {
    public static void test(String s1, String s2) {
        System.out.println(s1 + " == " + s2 + " : " + (s1 == s2));
        System.out.println(s1 + " equals " + s2 + " : " + (s1.equals(s2)));
    }
    public static void main(String[] args) {
        test("ab", "ab");
        test("ab", "a" + "b");
        test(new String("ab"), new String("ab"));
        test("ab", "ab".substring(0, 1) + "ab".substring(1, 2));
    }
}
