David Jason wrote:Is null some kind of special object ? If not, then it must be a reference to something, call it a "hole".
What is this "hole" like ? Please tell me if you know what it is and/or suggest some books which clearly
explain things like these.
Interesting question. I think the others have covered most of it; but it's worth knowing that in some languages (NOT Java; but in Smalltalk, I seem to remember, and probably some others)
Null (or
Nil) is a first-class type, sitting alongside
Object in the hierarchy; and very possibly implemented as a singleton.
This Wikipedia page may help to explain it a bit better than me. In it's terms, all Java reference types are "nullable".
It's might also interest you to know that v6 introduced a NullType into the Type hierarchy for parsing generic types.
Winston