Skip to content

Files

Latest commit

71978f3 · Oct 26, 2019

History

History

Chapter12

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 15, 2019
Sep 9, 2019
Oct 26, 2019

Optional

This chapter includes 24 problems meant to draw several rules for working with Optional. The problems and solutions presented in this section are based on the Brian Goetz (Java’s language architect) definition: Optional is intended to provide a limited mechanism for library method return types where there needed to be a clear way to represent “no result," and using null for such was overwhelmingly likely to cause errors. But, where there are rules there are exceptions as well. Therefore, do not conclude that the rules (or practices) presented here should be followed (or avoided) at all costs. Like always, it’s an it depends problem that requires to evaluate the situation and weight pros and cons.