Java Optional and null – Concepts, Design and Practice

Everything you ever wanted to know about null and Optional and more

This is an in-depth look at a truly fundamental concept in Java programming – ‘null’ and how Optional, if used properly can address many of the issues associated with null.

What you’ll learn

  • A deep understanding of null and Optional in Java.
  • A very strong understanding on how to design for null in your application.
  • How to use Optional and a host of other approaches to deal with particular null use cases.
  • How to spot common mistakes that are made when using Optional.
  • How to spot common design mistakes when working with null.

Course Content

  • Introduction to null and Optional –> 8 lectures • 49min.
  • Life Before Optional –> 2 lectures • 15min.
  • What is Java Optional –> 5 lectures • 31min.
  • Optional Methods in Detail –> 12 lectures • 1hr 47min.
  • Alternatives to Optional –> 14 lectures • 57min.

Auto Draft

Requirements

This is an in-depth look at a truly fundamental concept in Java programming – ‘null’ and how Optional, if used properly can address many of the issues associated with null.

 

Some of the questions I answer include:

 

Is null a bad concept or is the implementation that’s the problem?

How to prevent NullPointerExceptions?

How and when should Optional be used?

What are the alternatives to Optional?

What are some key design considerations in regards to null in my application?

What are other fundamental null concepts such as the Null Object Pattern etc?

How do some other languages handle null?

 

I hope that by the end of the course you will have a solid understanding of what null really is so you can design and develop your applications with confidence. I want to remove those nagging doubts you may have about null.

 

I’m hopeful that you will have a really strong understanding of how Javas Optional can help to deal with some of the issues surrounding null and also understand how it interplays with Streams. This is often what causes a lot of the confusion. However by understanding a few core concepts I believe this can be a thing of the past and you can use these tools in the best way possible.