title: Is object eligible for garbage collection after "obj = null"?
body: <p>I know <code>System.gc()</code> is not guaranteed to cause GC, but theoretically, in the following code, will the object <code>obj</code> be eligible for garbage collection?</p>
  
  <pre><code>public class Demo {
  
      public static void main(String[] args) throws Exception {
          SomeClass obj = new SomeClass();
          ArrayList list = new ArrayList();
          list.add(obj);
          obj = null;
          System.gc();
      }
  
  }
  
  class SomeClass {
      protected void finalize() {
          System.out.println("Called");
      }
  }
  </code></pre>