This was intended as a meme but is actually a good representation of what "Null" is. In C#, when you declare string s = "My shit"; it means that "s" is a reference to a memory location that holds the data "My shit". string s = null; means that the reference "s" exists but it's not pointing to any object, as in it holds nothing. Answer from abd53 on reddit.com
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Null
Null - Glossary - MDN Web Docs
In computer science, a null value represents a reference that points, generally intentionally, to a nonexistent or invalid object or address. The meaning of a null reference varies among language implementations.
Discussions

language agnostic - What is the purpose of null? - Stack Overflow
I am in a compilers class and we are tasked with creating our own language, from scratch. Currently our dilemma is whether to include a 'null' type or not. What purpose does null provide? Some of our More on stackoverflow.com
🌐 stackoverflow.com
What is Null?
This was intended as a meme but is actually a good representation of what "Null" is. In C#, when you declare string s = "My shit"; it means that "s" is a reference to a memory location that holds the data "My shit". string s = null; means that the reference "s" exists but it's not pointing to any object, as in it holds nothing. More on reddit.com
🌐 r/learnprogramming
60
34
July 5, 2024
What does “null” mean and why is it here
🌐 r/discordapp
43
51
March 21, 2023
What does 'null' mean in this piece of code?

Here it is just so that the variable "out" is set to something instead of being "uninitialized". Usually used in the finally block then you want to close it. and you cant access variables from inside the try block.

More on reddit.com
🌐 r/learnprogramming
6
3
December 29, 2014
🌐
Khoury College of Computer Sciences
khoury.northeastern.edu › home › kenb › MeaningOfNull.html
The Meaning of Null in Databases and Programming Languages
The main distinction between the relational null and the programming language null is the following: The relational null represents the absence of a value in a field of a record; whereas the programming language null represents one of the possible values of a variable.
🌐
freeCodeCamp
freecodecamp.org › news › a-quick-and-thorough-guide-to-null-what-it-is-and-how-you-should-use-it-d170cea62840
A quick and thorough guide to ‘null’: what it is, and how you should use it
June 12, 2018 - Please note also that some programming languages support only reference types, others support only value types, and some (e.g. C# and Java) support both of them. ... The concept of null exists only for reference types. It doesn't exist for value types. Suppose we have a type person with a field emailAddress. Suppose also that, for a given person which we will call Alice, emailAddress points to null. What does this mean?
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › csharp › language-reference › keywords › null
null keyword - C# reference | Microsoft Learn
January 26, 2026 - The null keyword is a literal that represents a null reference, one that doesn't refer to any object. null is the default value of reference-type variables. Ordinary value types can't be null, except for nullable value types.
🌐
Quora
quora.com › What-does-NULL-mean-in-programming-languages
What does NULL mean in programming languages? - Quora
Null can mean two different things in programming. Null can be a byte of data whose value is binary 00000000. We can call that the Null character. The C programming language uses a null character at the end of a string to signify the end, so ...
🌐
Wikipedia
en.wikipedia.org › wiki › Null
Null - Wikipedia
February 23, 2026 - Look up Null, null, a-null, núll, or Nullus in Wiktionary, the free dictionary. ... Null (SQL) (or NULL), a special marker and keyword in SQL indicating that a data value does not exist, is not known, or is missing. Null character, the zero-valued ASCII character, also designated by NUL, often ...
Find elsewhere
Top answer
1 of 16
49

Null: The Billion Dollar Mistake. Tony Hoare:

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. In recent years, a number of program analysers like PREfix and PREfast in Microsoft have been used to check references, and give warnings if there is a risk they may be non-null. More recent programming languages like Spec# have introduced declarations for non-null references. This is the solution, which I rejected in 1965.

2 of 16
32

null is a sentinel value that is not an integer, not a string, not a boolean - not anything really, except something to hold and be a "not there" value. Don't treat it as or expect it to be a 0, or an empty string or an empty list. Those are all valid values and can be geniunely valid values in many circumstances - the idea of a null instead means there is no value there.

Perhaps it's a little bit like a function throwing an exception instead of returning a value. Except instead of manufacturing and returning an ordinary value with a special meaning, it returns a special value that already has a special meaning. If a language expects you to work with null, then you can't really ignore it.

🌐
ThoughtCo
thoughtco.com › definition-of-null-958118
What Does Null Mean in C, C++ and C#?
April 27, 2019 - Null is a constant built into C, C++, and C#. It has a value of zero. Null can also be the value of a pointer that points nowhere.
🌐
TechTerms
techterms.com › definition › null
Null Definition - What does null mean to a computer?
September 26, 2022 - It does not mean a value of 0, since 0 is itself a value, nor does it mean a blank space " ". It also does not refer to an undefined variable, which has not been created at all. In the context of programming languages, a variable that has no value assigned is considered null.
🌐
W3Schools
w3schools.com › c › c_null.php
C NULL
NULL is a special value that represents a "null pointer" - a pointer that does not point to anything.
🌐
Coderanch
coderanch.com › t › 688734 › java › null
what does null mean? (Beginning Java forum at Coderanch)
Yep, null means it does not have any value whatsoever - not even zero or an empty String. It's very annoying and probably one of the main downfalls of Java as a language because it means you have to check variables for null everywhere, otherwise you'll get NullPointerExceptions being thrown, ...
🌐
TechCareer
techcareer.net › en › dictionary › null
What is Null? What does it do?
Null, in many programming languages, means "empty" or "nothing." It is used to indicate that a variable has no value. Null shows that an object or reference does not contain any data or does not point to an object.
🌐
DevX
devx.com › home › null
Null - Glossary
January 17, 2024 - It is commonly used in programming ... that a variable or reference has not been assigned any value or has been deliberately set to have no value. Using “null” helps in detecting errors or handling cases where data is missing or irrelevant in a system. Null is a special value in programming that represents the absence of any value or object...
🌐
Lenovo
lenovo.com › home
Null Pointer in Programming – Definition, Uses, and Common Pitfalls | Lenovo US
A null pointer is a special type of pointer in programming that points to no valid memory location or object. It is used to indicate that the pointer doesn’t contain a usable or meaningful memory address.
🌐
PCMAG
pcmag.com › home › encyclopedia › n
Definition of null | PCMag
A null may function as a delimiter; for example, in C/C++, a null character is inserted at the end of a character string to mark the end of the text. The Null Is the First Note the first character at the top of this chart of ASCII characters.
🌐
Medium
medium.com › @sumeet2703 › understanding-the-difference-between-zero-and-null-in-programming-db60b4e12934
Understanding the Difference Between Zero and Null in Programming | by Sumeet K | Medium
September 4, 2024 - Null, on the other hand, represents the absence of a value or a reference. It is not a number, nor is it a default value—it signifies that a variable has not been assigned any value at all.
🌐
Upwork
upwork.com › resources › articles › {name}
Null in Java: Understanding the Basics - Upwork
August 5, 2024 - It is neither an object nor a type (a common misconception some newcomers to the Java language grapple with). The concept of null was introduced in programming languages to represent the absence of a value or a non-existent object.
🌐
DataCamp
datacamp.com › doc › java › null
null Keyword in Java: Usage & Examples
Java keywordsIntroduction To JavaJava File HandlingJava Language BasicsJava ArraysJava Object-Oriented Programming ... The null keyword in Java is a literal that represents a null reference, one that points to no object.
🌐
Programmer's Wiki
code.fandom.com › wiki › Null
Null | Programmer's Wiki | Fandom
null (often NULL, or nil) is a constant used in many programming languages to indicate that the expected value is unknown. It is different from 0, the empty string, and false because these are known to be empty.