I was having a query that is if we have constructor in the class as below..
class A
{
A{}
}
Now what is the alternative to the constructors , I have gone for the approach that is static factory methods
class A
{
public staic A getinstance()
{
return new A();
}
}
In the above approch as per the analysis it will return immutable object but I have doubt on this analysis as the object that can be return with static factory method and can later be changed on , How to make it completely immutable..!! please advise..!!