Is the address of an object constant during its life cycle or can it change? I just thought address of an object never changes. Is it JVM dependent? I Haven\'t found any cle
Not in general. Many JVM garbage collectors will move objects around, and the language makes no guarantees about the object's location.
There are some GCs (plain Mark&Sweep, for example) that do not; you can use a specialised JVM that supports these (such as a custom build of Jikes RVM) if you require this feature.
Note that each object can still contain a (mostly) unique ID (at least in the JVMs that I have seen), partly to support a basic implementation of hashcode.