Possible Duplicate:
What exactly is null in Java memory
Does anyone know how a null value is represented in the memory for an object or anything. In dot net it is represented by null indicator Boolean value and value of the corresponding type (Refer here). So does any one know how it is done in java ??
From the JVM specification, section 2.4:
So it could be anything, but it’s very likely to be a reference value which is all zeroes. References themselves can be simple pointers (i.e. just a virtual address in the same way as a native pointer, of the appropriate size for the architecture) but again don’t have to be. Some JVMs have very smart ways of handling references – for example, Hotspot is able to use 32-bit values for references in many situations, even when running in an x64 process.