I'm not sure what you are asking, but if you are looking for an example of when you want to use the null key, I often use them on maps to represent the default case (that is, the value that should be used if this key is missing):
Map<A, B> foo; A search; B val = foo.containsKey(search) ? foo.get(search) : foo.get(null);
HashMap processes null keys specially (since it cannot call .hashCode() for a null object), but null values ββare not something special, they are stored on the map, like everything else
Michael Mrozek May 31 '10 at 18:32 2010-05-31 18:32
source share