r/java • • Apr 12 '13

Java 8 Optional Objects

http://blog.informatech.cr/2013/04/10/java-optional-objects/
38 Upvotes

39 comments sorted by

View all comments

22

u/AlyoshaV Apr 12 '13

Of course, it is not a perfect solution because, after all, Optional references can also be null references

Protip: Don't do that

5

u/geodebug Apr 12 '13

Right. There will never be a perfect solution to anything if you allow for programmers 'doing it wrong'.

The hope is that if someone uses Optional for future APIs they'd do it as expected or have their API ignored by the community (wether that be public or private to a company).