"p" == pickard  <[EMAIL PROTECTED]> writes:

  p> Is there a way to ask the VM if there is an instance of an Object
  p> already in the VM and get a copy of that instance?

The short answer is no. There is no concept of memory and no concept of
a VM in Java. So you can't go rummaging around memory looking for
things, and (basically) you can't ask the VM to do anything except
execute bytecodes.

The longer answer is yes, provided you're willing to do some work
beforehand. You do have references, and you can manipulate them, store
them, and pass them around. There are even references with different
properties with respect to the garbage collector. 

So, if you're willing to create a reference to the instance you will be 
interested it before you need it, and store it somewhere, you can later
retrieve that reference at some later date and use it.

---Vladimir

Vladimir G. Ivanovic                    http://www.leonora.org/~vladimir
2770 Cowper St.                                         [EMAIL PROTECTED]
Palo Alto, CA 94306-2447                                 +1 650 678 8014


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to