title: Create same object multiple times in different function or use single instance?
body: <p>I am creating <code>AlertDialog.Builder</code> to display user whether data is available or not, entry is deleted or not etc. I am confused about creating object in <code>onCreate()</code> method or creating local object of <code>AlertDialog.Builder</code> in function. Which one is optimal?</p>
  
  <p>I guess  creating a single object in o<code>nCreate()</code> because it located once memory from heap  and it required throughout <code>Activity</code> . Am I correct or not?</p>
  
  <pre><code>//This Alert Dialog use for various button .That's why we building single Object only
  AlertDialog.Builder  buidler  = new AlertDialog.Builder(MainActivity.this);
  </code></pre>