title: Update all references to an object when the object is updated(reference to a reference)
body: <p>I want to declare an object in java that is like a a pointer to a pointer in C++, let me show you an example : </p>
  
  <pre><code>//*** At the application startup
  
  //Initialize a settings container class
  Settings settings = //Load settings 
  
  //Declaring static Application class that contain a reference to the settings container
  Application.setSettings(settings);
  
  //Get sub settings from settings container class
  DatabaseSettings dbSettings =  settings.getDbSettings();
  LogSettings logSettings = settings.getLogSettings();
  
  //Initialize components 
  DatabaseConnector dbConn = new DatabaseConnector(dbSettings);
  Logger logger = new Logger(logSettings);
  </code></pre>
  
  <p>In the above code i have created a settings container class that contain all settings of my application components, then i have assigned each sub settings class to the related component, at this point during the execution of the program i want to update the settings and let the component of the application to see the updated settings, so for example during the execution i can update the settings container in this way : </p>
  
  <pre><code>//Update settings through Application static class 
  Settings newSettings = //assign updated settings
  Application.setSettings(newSettings);
  </code></pre>
  
  <p>Now the problem is that when i update the settings container at runtime the application static class will contain the updated reference to the <code>newSettings</code> instance while each sub Settings instance keep referencing the old sub settings, so : </p>
  
  <pre><code>dbConn      ---&gt; settings.getDbSettings()
  logSettings ---&gt; settings.getLogSettings()
  </code></pre>
  
  <p>While i want that the two reference automatically reference to the new instance of the settings, so : </p>
  
  <pre><code>dbConn      ---&gt; newSettings.getDbSettings()
  logSettings ---&gt; newSettings.getLogSettings()
  </code></pre>
  
  <p>It is like a pointer to pointer ... Is it possible in Java ? How can it be done ? </p>