there are some objects that we create without using new operator. like Display object (Display.getDisplay())in j2me (this example is currently coming to my mind). Why do we not use the new operator?
Printable View
there are some objects that we create without using new operator. like Display object (Display.getDisplay())in j2me (this example is currently coming to my mind). Why do we not use the new operator?
Because it probably uses simpletons, or wants to make sure that certain actions (which are not necessarily part of the object creation, or can only take place after object creation) are performed every time the object is created, etc, etc, etc.
Thank you :)