---
title: "Discussion on \"Null Object Pattern\" | Hashnode"
description: "Discussion on \"Null Object Pattern\". The null object pattern replaces null values within a specific object with a custom null object that is of the same class. The null object's fields will have default values, preventing it from causing a null pointer exception.\nExample\nf we don't use ..."
url: "https://hashnode.com/posts/null-object-pattern/6522527c16cc7dc4b57a8773"
---

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

Discussion

# [Null Object Pattern](https://chetan77.hashnode.dev/null-object-pattern?utm_source=hashnode&utm_medium=feed)

The null object pattern replaces null values within a specific object with a custom null object that is of the same class. The null object's fields will have default values, preventing it from causing a null pointer exception. Example f we don't use ...

Oct 8, 2023 · 2 min read · chetan77.hashnode.dev  
Updated Nov 3, 2023  
Read the article

-   [#software-development](https://hashnode.com/tag/software-development)
-   [#system-design](https://hashnode.com/tag/system-design)
-   [#java](https://hashnode.com/tag/java)
-   [#null-object-design-pattern](https://hashnode.com/tag/null-object-design-pattern)

## Written by

[Chetan Datta](https://hashnode.com/@chetan77)

@chetan77 · Hyderabad, India

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

Software Engineer

I share my learnings here. Thanks for reading.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
