Modern Java Features in Java
Lessons in this section
- Optional
Handle missing values safely with Optional: create one with of, ofNullable and empty, then use isPresent, ifPresent, orElse and orElseGet.
- Pattern Matching
Check a value's type and use it in one step with pattern matching for instanceof and switch, including guards, null cases and record patterns.