I read this quote from some website:
If the class of the object returned can be private (non-public), there is a degree of encapsulation where the private class can be modified without impacting clients of the API (possibly for bug-fixing or improvements, or just plain maintainence). The private classes can also vary depending on the parameters to the static factory, so long as they are subtypes of the return type, allowing for greater flexibility.
I really don't get the connection between class of returned object being private and degree of encapsulation. And how does that allow for greater flexibility? can anybody please explain more? or some examples?