Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to know is object created

Reply
Thread Tools

how to know is object created

 
 
column.column@gmail.com
Guest
Posts: n/a
 
      01-21-2008
Hello,

Is it possible to know is class object created?

Thank you
 
Reply With Quote
 
 
 
 
GArlington
Guest
Posts: n/a
 
      01-21-2008
On Jan 21, 11:09 am, (E-Mail Removed) 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?
 
Reply With Quote
 
 
 
 
Andreas Leitgeb
Guest
Posts: n/a
 
      01-21-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How can i know the String object is created or is null mahesh Java 5 12-11-2006 03:58 AM
know can I know how much object has been created??? sayoyo@yahoo.com Ruby 2 03-31-2006 08:09 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
I know, I know, I don't know Andries Perl Misc 3 04-23-2004 02:17 AM



Advertisments