September 2019
Intermediate to advanced
816 pages
18h 47m
English
Initializing Optional should be done via Optional.empty() instead of null:
// AvoidOptional<Book> book = null;// PreferOptional<Book> book = Optional.empty();
Since Optional acts as a container (box), it is meaningless to initialize it with null.
Read now
Unlock full access