Getting Object IDs?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Ottinger

    Getting Object IDs?

    I was wondering if there is a good way to get object IDs.
    In most OO languages, there is a value which is an object
    ID, which is absolutely specific to the identity of one
    and exactly one object in memory. In C++ they use the
    address of the first byte of the object in memory. In
    others they have an OID which identifies the object.

    In java, how do I get the OID. Don't worry, I need it
    for debugging something, and have programmed far too
    long to try to use it for anything in production.

    Tim
  • Doug Pardee

    #2
    Re: Getting Object IDs?

    "Tim Ottinger" <tottinge@indy. rr.com> wrote:[color=blue]
    > I was wondering if there is a good way to get object IDs.[/color]

    int oid = System.identity HashCode(obj);

    Comment

    Working...