previous | start | next

Requiring Keys Not be null

All implementations of the Symbol Table methods (put(k,v), get(k), delete(k)) will need to to compare k with the at least some of keys stored in the Symbol Table.

How?

The obvious way to compare k with a key k1 stored in the symbol table:

      k.equals(k1) 
   

But if k == null this will throw a NullPointerException.

Requiring that keys in the symbol table not be null means put, get, and delete require k not be null and so they can always use the equals method for comparison.



previous | start | next