title: Copying a Timestamp object's value to another object
body: <p>I have a date in Java.sql.Timestamp object (variable-> confirmedDeliveryDate), i wanted to create a different object and add a few days to it. I created ts as a different timestamp variable and I used the following logic. I am able to add days successfully. But as soon as ts gets updated with new time, confirmedDeliveryDate is also updating with the new date. When I have created a  new object for ts why is confirmedDeliveryDate being updated. And please suggest solution for the same.        </p>
  
  <pre><code>            Timestamp ts = new Timestamp(0L);
  
              ts=confirmedDeliveryDate;
  
              Calendar cal = Calendar.getInstance();
              cal.setTime(ts);
              cal.add(Calendar.DAY_OF_WEEK, 5);
              ts.setTime(cal.getTime().getTime());
              ts = new Timestamp(cal.getTime().getTime());
  </code></pre>