// 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 ObjectCreate {
    private final static int N = 1000000000;
    public static void main(String[] args) {
        test1();
        test2();
    }
    private static void test1() {
        String s1 = "Dette er en test";
        String s2 = null;
        long t = System.currentTimeMillis();
        for(int i = 0; i < N; i++) {
            s2 = s1;
        }
        System.out.println("1: " + (System.currentTimeMillis() - t));
    }
    private static void test2() {
        String s1 = "Dette er en test";
        long t = System.currentTimeMillis();
        for(int i = 0; i < N; i++) {
            String s2 = s1;
        }
        System.out.println("2: " + (System.currentTimeMillis() - t));
    }
}
