开发者

Using key and values in collections

Is there any way to make a key for searching the values in the collections开发者_如何转开发 and not returning null keys and values?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜