Results 1 to 5 of 5
  1. #1
    sunnyboy is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default why create object without new operator

    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?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    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.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    Quote Originally Posted by masijade View Post
    Because it probably uses simpletons, ...
    Freudian slip?
    ;)

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Quote Originally Posted by Tolls View Post
    Freudian slip?
    ;)
    Intentional, however. ;-)

  5. #5
    sunnyboy is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

Similar Threads

  1. What is best object to create?
    By lam5442 in forum New To Java
    Replies: 1
    Last Post: 02-23-2011, 09:44 PM
  2. Replies: 2
    Last Post: 11-26-2010, 02:12 AM
  3. Can we create object without new operator ?
    By rohitjava in forum New To Java
    Replies: 11
    Last Post: 09-08-2010, 05:26 AM
  4. Replies: 2
    Last Post: 06-22-2010, 04:29 AM
  5. String Object equality with == operator
    By kumar080780 in forum New To Java
    Replies: 4
    Last Post: 10-29-2008, 06:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •