title: Java Android Bitmap references
body: <p>I am creating this Android project with Java. However, I am wondering a bit how far the references with some Bitmap methods will go.</p>
  
  <p>I have an originally Bitmap just like:</p>
  
  <pre><code>Bitmap originalBitmap = BitmapFactory.decodeResource(resources, bitmapID);
  </code></pre>
  
  <p>and then I send it to an object within its constructor of a basic class:</p>
  
  <pre><code>class Test
  {
      Bitmap memberBitmap;
  
      Test(Bitmap b)
      {
          memberBitmap = b;
      }
  }
  </code></pre>
  
  <p>This far, I know memberBitmap is still a reference to originalBitmap. But what I would like to do is basically resize this Bitmap using:</p>
  
  <pre><code>memberBitmap = Bitmap.createScaledBitmap(memberBitmap, newWidth, newHeight, filter);
  </code></pre>
  
  <p>Have I now stored a new Bitmap to the memory or have I changed the originalBitmap?</p>
  
  <p>If it's so that I have created a new Bitmap, would there be any alteration to make it update the originalBitmap instead?</p>
  
  <p>Like:</p>
  
  <pre><code>memberBitmap.createScaledBitmap(memberBitmap, newWidth, newHeight, filter);
  </code></pre>