Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional 详解 | Andrewei #2

Open
andrewei1316 opened this issue Oct 11, 2020 · 0 comments
Open

Optional 详解 | Andrewei #2

andrewei1316 opened this issue Oct 11, 2020 · 0 comments

Comments

@andrewei1316
Copy link
Owner

https://andrewei1316.github.io/2019/05/18/java-optional/

定义 Optional 的出现主要为了解决 NullPointerExcepton 的异常。 Optional 是一个值的容器,用来存储一个 Object 或者 null。 它是一个基于值的类(value-base class)。 基于值的类(value-base class) 需要满足以下几个条件: 必须为 final 和 不可变的(可以包含可变对象的引用); 必须实现 equals、

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant