title: Java - Anonymous Inner Class Life Cycle
body: <p>When using an anonymous inner class as a PropertyChangeListener at what point in the object life cycle is the class garbage collected? After the containing class (SettingsNode) is reclaimed? Should I explicitly remove the PropertyChangeListener in the finalizer of the containing class (SettingsNode)?</p>
  
  <pre><code>public class SettingsNode extends AbstractNode
  {
      public SettingsNode(Project project, ProjectSettings projectSettings)
          throws IntrospectionException
      {   
          // use an anonymous inner class to listen for changes
          projectSettings.addPropertyChangeListener(ProjectSettings.PROP_NAME,
              new PropertyChangeListener()
              {
                  @Override
                  public void propertyChange(PropertyChangeEvent evt)
                  {
                     // handle event
                  }
              });
       }
  }
  </code></pre>