package jvm.gc;

public class PrintMemoryAddress {
    public Object getObj() {
        Object o = new Object();
        System.out.println(STR."The addree is \{System.identityHashCode(o)}");
        return o;
    }

    public void showObj() {
        Object o = getObj();
        Object o2 = new Object();
        System.out.println(STR."Now the addree is \{System.identityHashCode(o)}");
        System.out.println(STR."The addree of o2 is \{System.identityHashCode(o2)}");
    }

    public static void main(String[] args) {
        PrintMemoryAddress printMemoryAddress = new PrintMemoryAddress();
        printMemoryAddress.showObj();
    }
}
