Created
December 15, 2019 03:26
-
-
Save benweidig/8239d52f808fac802e8b9fb6ff1971bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optional<String> withValue = Optional.of("definitly a string"); | |
if (withValue.isPresent()) { | |
System.out.println("There's definitly something there!"); | |
} | |
Optional<String> noValue = Optional.empty(); | |
if (noValue.isPresent() == false) { | |
System.out.println("No, nothing..."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment