how to know is object created

Discussion in 'Java' started by column.column@gmail.com, Jan 21, 2008.

  1. Guest

    Hello,

    Is it possible to know is class object created?

    Thank you
    , Jan 21, 2008
    #1
    1. Advertising

  2. GArlington Guest

    On Jan 21, 11:09 am, wrote:
    > Hello,
    >
    > Is it possible to know is class object created?
    >
    > Thank you


    If (objRef != null)
    or do you mean if it is created successfully, whatever you would mean
    by this?
    GArlington, Jan 21, 2008
    #2
    1. Advertising

  3. <> wrote:
    > Hello,
    > Is it possible to know is class object created?


    By hooking into the classloader (that is: install your own derived
    classloader), you would be able to keep track of which classes are
    being loaded (except for those loaded by system's classloader).

    If it's about your own classes, you could have a static initializer
    block "static { ... }" register the class somewhere central, e.g.
    by adding it's name to a Collection in a central class, so you'll
    find it, once it's loaded.

    If these all fail, reflection might also offer ways...

    Why do you even want to know? If you try to use the class, and
    it isn't yet loaded, then it will be.
    Andreas Leitgeb, Jan 21, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ulf Heyder
    Replies:
    0
    Views:
    563
    Ulf Heyder
    Oct 16, 2003
  2. jimjim
    Replies:
    12
    Views:
    1,891
    Ron Natalie
    Jun 3, 2005
  3. mahesh
    Replies:
    5
    Views:
    324
    mahesh
    Dec 11, 2006
  4. Replies:
    2
    Views:
    117
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    228
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page