William Brogden wrote:Given that all Java memory allocation sets the locations to zero, the value in memory for a null reference is zero.
If you set a variable to
null, then what the actual bits of the reference in memory look like depends on JVM implementation details. It doesn't necessarily have to be zeroes. But it's not something you need to be concerned about, because you can't access the direct value of a reference variable anyway.