Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.ref.WeakReference;
import java.util.LinkedList;
import java.util.List;

public class Main {
    private static List<WeakReference<Object>> list = new LinkedList<>();

    public static void observeObject(Object obj) {
        list.add(new WeakReference<Object>(obj));
    }
}