About the usage of optional

Optional is a tool class that is used to avoid null pointer exceptions. Compared with the traditional java using if to judge whether it is null, the biggest advantage of optional is that it can avoid if nesting (judging whether it is null or not), and
it can be called in a chain. The semantics are very good, concise, and easy to understand.

http://www.importnew.com/26066.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326174782&siteId=291194637