I have a Java gettor method that looks like the following:
import java.util.Date; //... public Date getSomeDate() { return someDate; }
an
No,we need to clone that object using below code :
public Date getSomeDate() { return new Date(someDate.getTime()).clone(); }