Prabhat Ranjan wrote:My answer is below one.
Please comments any one who is expert and used fully.
Campbell Ritchie wrote:I can think of four more ways. Or maybe they are 3½ ways.
Campbell Ritchie wrote:No, 4½.
Chan Ag wrote: . . .
Interesting. One of them, I think, is the enum(s)? Thinking about the other three and a half ways now .. :-)
. . .
Ulf Dittmer wrote:... As to the answer, all options but #4 are highly likely to be identical, namely, calling the no-argument constructor. ...
fred rosenberger wrote:Doesn't it depend on what you mean by 'create an instance'? for example, de-serializing an object implies the object has already been created. It's like a balloon that has been deflated. Blowing it up doesn't "create" a balloon, does it? Or perhaps a better example is a piece of sheet music. Does the song exist when it's just written down, or does it only exist when it is being performed?