-
-
Save theboreddev/d56f480a014a1f0567a92d430fd9f8ca to your computer and use it in GitHub Desktop.
customerWithNullOptionals
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
final Customer customerWithNullOptionals = new Customer( | |
"John", | |
"Smith", | |
null, | |
null, | |
Optional.of("01234 567890"), | |
Optional.of(Sex.MALE) | |
); | |
System.out.println(customerWithNullOptionals.getAddress().orElse("No address present!")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment