null point exception
Optional(T value),empty(),of(T value),ofNullable(T value)
- 当value值为null时,of(T value)会报NullPointerException异常;
- ofNullable(T value)不会throw Exception,ofNullable(T value)直接返回一个EMPTY对象
Optional(T value),empty(),of(T value),ofNullable(T value)