title: create a new object from existing object
body: <p>I have a method called xyz which returns an object.</p>
  
  <pre><code>private XYZ xyz() {
       return abc;
  }
  </code></pre>
  
  <p>I want to use this method in 2 different places but I want to call the method only once.</p>
  
  <p>I mean for the first time I am calling the method to get the object.</p>
  
  <pre><code>   XYZ aaa = xyz();
  </code></pre>
  
  <p>Here I have an object 'aaa'. And I want to use the same object in different place, but I can't use this object as this is private. So what I want to do is to create a new object called 'bbb' from 'aaa' without calling the method.
  Just like bbb = aaa;
  Please help me how to create a new object from existing object or create a duplicate object with different name.</p>
  
  <p>Thanks in advance</p>