Skip to content

Commit a89c989

Browse files
Feature: Added notes for Optional - work in porgress.
1 parent bae6ddc commit a89c989

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ A container object which may or may not contain a non-null value. It contains se
112112

113113
Additional methods that depend on the presence or absence of a contained value are provided, such as _orElse()_ (return a default value if value not present) and _ifPresent()_ (execute a block of code if the value is present).
114114

115+
Optional is implemented in the _Optional_ class in the project. In the main method, the code
116+
117+
```java
118+
119+
final Optional<Object> empty = Optional.empty();
120+
121+
```
122+
123+
means that Optional object is empty. Due to this, __isPresent()__ returns false whereas __isEmpty()__ returns true.
124+
115125
- Add a picture linking imperative and declarative approach together.
116126

117127
## Explanation Predicate

0 commit comments

Comments
 (0)