Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Java Coding Problems

You're reading from   Java Coding Problems Improve your Java Programming skills by solving real-world coding challenges

Arrow left icon
Product type Paperback
Published in Sep 2019
Publisher Packt
ISBN-13 9781789801415
Length 816 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Anghel Leonard Anghel Leonard
Author Profile Icon Anghel Leonard
Anghel Leonard
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Strings, Numbers, and Math 2. Objects, Immutability, and Switch Expressions FREE CHAPTER 3. Working with Date and Time 4. Type Inference 5. Arrays, Collections, and Data Structures 6. Java I/O Paths, Files, Buffers, Scanning, and Formatting 7. Java Reflection Classes, Interfaces, Constructors, Methods, and Fields 8. Functional Style Programming - Fundamentals and Design Patterns 9. Functional Style Programming - a Deep Dive 10. Concurrency - Thread Pools, Callables, and Synchronizers 11. Concurrency - Deep Dive 12. Optional 13. The HTTP Client and WebSocket APIs 14. Other Books You May Enjoy

Optional

This chapter includes 24 problems meant to draw your attention to several rules for working with Optional. The problems and solutions presented in this section are based on the Java language architect Brian Goetz's 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. As always, it depends on the problem, and you have to evaluate the situation, weighing up the pros and cons.

You may also like to check the CDI plugin (https://github.com/Pscheidl/FortEE) for Java EE (Jakarta EE) developed by Pavel Pscheidl. This is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime