Hi, Is there any way to make a key for searching the values in the collections and not returning null keys and values?
A:
Just implement your own Map
which throws for example IllegalArgumentException
instead of returning null
.
All with all, this makes no sense. If you want, just test the existence of the key using Map#containsKey()
and/or check if the returned value is null
or not.
BalusC
2010-01-21 21:15:56
thanks for your answer.
Johanna
2010-01-21 21:22:12