开发者

Using key and values in collections

开发者 https://www.devze.com 2022-12-17 07:50 出处:网络
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 IllegalArgumentE

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

精彩评论

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

关注公众号