---
title: "Discussion on \"How to use Java Optional to handle NullPointerException?\" | Hashnode"
description: "Discussion on \"How to use Java Optional to handle NullPointerException?\". Tony Hoare, the inventor of the null reference, famously referred to it as his “billion-dollar mistake”."
url: "https://hashnode.com/posts/how-to-use-java-optional-to-handle-nullpointerexception/65d5b114d2bdbaadfc6501a1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to use Java Optional to handle NullPointerException?](https://ayushsblog.hashnode.dev/how-to-use-java-optional-to-handle-nullpointerexception?utm_source=hashnode&utm_medium=feed)

Tony Hoare, the inventor of the null reference, famously referred to it as his “billion-dollar mistake”.

Feb 21, 2024 · 9 min read · ayushsblog.hashnode.dev  
Read the article

-   [#developer](https://hashnode.com/tag/developer)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#coding](https://hashnode.com/tag/coding)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#java](https://hashnode.com/tag/java)

## Written by

[Ayush Singhal](https://hashnode.com/@ayushsinghal90)

@ayushsinghal90 · India

  
[View profile](https://hashnode.com/@ayushsinghal90)

Senior Engineer at Amazon

Trying to share knowledge.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
