Unique identifier for each object

Hello,I would like to know how can i generate a unique identity for each object. Any ideas how can this be done?
[126 byte] By [Charalambosa] at [2007-11-27 6:42:40]
# 1
You have one! The object reference is a unique identifier.What do you want to use it for?
sabre150a at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...
# 2
In what scope? During the lifetime of the JVM? Or should it be persistent? Should it be unique across different JVM's, even across different machines? Anyway, this was discussed. If only the forums and generally the web were searchable!
BIJ001a at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...
# 3
> If only the forums and generally the web were> searchable!The web is 'searchable' but the forum is only 'searchable' via the web!
sabre150a at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...
# 4

hi,

The object reference does it always remain the same? ...because my findings are different. Basically i create one object that i move it around from one objects arraylist to another objects arraylist... What i need to do is to be able to uniquely identify this object so thats i can take some measurements. I wasnt lucky with my searches... maybe i am not phrasing something correctly. Could you please explain or give me a link to a solution for such problem?

p.s: The id needs to be unique only over one JVM

Charalambosa at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...
# 5
> The object reference does it always remain the same?Yes!
sabre150a at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...
# 6

> > The object reference does it always remain the

> same?

>

> Yes!

depends on your definition of "always".

If you restart the JVM you'd get another one, if you let the thing go out of scope and recreated it from some resource it'd get another one, if you run the thing on several machines simultaneously it'd almost certainly be different on each one.

jwentinga at 2007-7-12 18:12:52 > top of Java-index,Java Essentials,Java Programming...