String str = null;

means a String reference, named str, not pointing to anything

String str = "";

means a String reference, named str, pointing to an actual String instance. And for that String instance, it is a zero-length String, but it is still an actual object.


Just a little update with some diagram which hopefully can help you visualize that:

assume I have

String nullStr = null;
String emptyStr = "";
String myStr = "ab";

What it conceptually is something look like:

  // String nullStr = null;

  nullStr ----------> X    pointing to nothing



  // String emptyStr = "";
                      +------------------+
  emptyStr ---------> |       String     |
                      +------------------+
                      | length = 0       |
                      | content = []     |
                      +------------------+


  // String myStr = "ab";
                      +------------------+
  myStr ------------> |       String     |
                      +------------------+
                      | length = 2       |
                      | content = [ab]   |
                      +------------------+

(of course the internal structure of the String object is not the real thing in Java, it is just for giving you an idea)


More edit for the rationale behind NULL:

In fact in some language they do not provide concept of NULL. Anyway, in Java (or similar language), Null means semantically different from "empty" object. Use String as an example, I may have a People class with a String preferedTitle attribute. A Null preferedTitle means there is NO preferred title for that people (so that we need to derive and show the title for it, maybe), while a preferedTitle being an empty string means there IS a preferred title, and that's showing nothing.

Btw, although a bit off topic: concept of Null is seen as problematic for some people (because all those extra handling it need etc). Hence some languages (e.g. Haskell) are using some other ways to handle the situation where we used to use Null.

Answer from Adrian Shum on Stack Overflow
null
/nŭl/
adjective
  1. Having no legal force; invalid.
    render a contract null and void.
  2. Of no consequence, effect, or value; insignificant.
  3. Amounting to nothing; absent or nonexistent.
    a null result.
from The American Heritage® Dictionary of the English Language, 5th Edition. More at Wordnik
🌐
Merriam-Webster
merriam-webster.com › dictionary › null
NULL Definition & Meaning - Merriam-Webster
2 weeks ago - The meaning of NULL is having no legal or binding force : invalid. How to use null in a sentence. Did you know?
🌐
Cambridge Dictionary
dictionary.cambridge.org › us › dictionary › english › null
NULL | definition in the Cambridge English Dictionary
1 week ago - NULL meaning: 1. having no legal force: 2. with no value or effect: 3. (of a set or matrix) containing nothing…. Learn more.
🌐
Vocabulary.com
vocabulary.com › dictionary › null
Null - Definition, Meaning & Synonyms | Vocabulary.com
Null means having no value; in other words null is zero, like if you put so little sugar in your coffee that it’s practically null. Null also means invalid, or having no binding force.
Discussions

java - What does is mean by null pointing to nothing and why use null at all? - Stack Overflow
There are a lot of questions about null and in java. What I am failing to grasp is what people mean by null is pointing to nothing or why to use null at all. I can't understand the difference be... More on stackoverflow.com
🌐 stackoverflow.com
What does “null” mean and why is it here
🌐 r/discordapp
43
51
March 21, 2023
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
ELI5:What is the difference between 'null' and 'void'?
A contract is null if it's completely nonsensical or illegal to begin with. By virtue of it being null, it is void. A legal contract however, is not null, but it may stipulate terms in which it would later become void - for instance, me forcing you at gunpoint to sign a contract to hand over your assets to me would be a null contract, but you voluntarily signing the contract out of free will would not be null, but you may say that this handover only occurs if I am proven to be your kin. Failing that, the contract is void. More on reddit.com
🌐 r/explainlikeimfive
3
1
December 27, 2014
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › everyday-types.html
TypeScript: Documentation - Everyday Types
Change 2 means “I know for other reasons that req.method has the value "GET"“. You can use as const to convert the entire object to be type literals: ... The as const suffix acts like const but for the type system, ensuring that all properties are assigned the literal type instead of a more general version like string or number. JavaScript has two primitive values used to signal absent or uninitialized value: null and undefined.
🌐
Dictionary.com
dictionary.com › browse › null
NULL Definition & Meaning | Dictionary.com
NULL definition: without value, effect, consequence, or significance. See examples of null used in a sentence.
Find elsewhere
🌐
Biztory
biztory.com › blog › 7-things-you-should-know-about-null-values
7 Things to know about NULL values - Biztory | Biztory
October 25, 2025 - Some people have a nasty tendency to impute the mean or an arbitrary value (e.g. 99, 100, 0, -1) directly into the database. If a value appears suspiciously often or seems impossible; it might be an attempt to input NULL values.
Top answer
1 of 9
6
String str = null;

means a String reference, named str, not pointing to anything

String str = "";

means a String reference, named str, pointing to an actual String instance. And for that String instance, it is a zero-length String, but it is still an actual object.


Just a little update with some diagram which hopefully can help you visualize that:

assume I have

String nullStr = null;
String emptyStr = "";
String myStr = "ab";

What it conceptually is something look like:

  // String nullStr = null;

  nullStr ----------> X    pointing to nothing



  // String emptyStr = "";
                      +------------------+
  emptyStr ---------> |       String     |
                      +------------------+
                      | length = 0       |
                      | content = []     |
                      +------------------+


  // String myStr = "ab";
                      +------------------+
  myStr ------------> |       String     |
                      +------------------+
                      | length = 2       |
                      | content = [ab]   |
                      +------------------+

(of course the internal structure of the String object is not the real thing in Java, it is just for giving you an idea)


More edit for the rationale behind NULL:

In fact in some language they do not provide concept of NULL. Anyway, in Java (or similar language), Null means semantically different from "empty" object. Use String as an example, I may have a People class with a String preferedTitle attribute. A Null preferedTitle means there is NO preferred title for that people (so that we need to derive and show the title for it, maybe), while a preferedTitle being an empty string means there IS a preferred title, and that's showing nothing.

Btw, although a bit off topic: concept of Null is seen as problematic for some people (because all those extra handling it need etc). Hence some languages (e.g. Haskell) are using some other ways to handle the situation where we used to use Null.

2 of 9
4

String str is a reference to an object. That is, it's not an actual object, but a variable which can contain the address of an object. When you assign a value to str you are changing the address stored within and changing which object it addresses.

null is reference value which points to no object. It's about as close to nothing as you can get. If you assign null to a String reference (String str = null;), you cannot then invoke any method of String using that reference -- all attempts will result in NullPointerException.

"" is a character String which contains no characters -- zero length. It is still an object, though, and if you assign its address to your String reference variable (String str = "";) you can then take its length, compare it to another String, extract its hashCode, etc.

🌐
Slang.org
slang.org › slangterm › null
Null Meaning
October 9, 2020 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Cambridge Dictionary
dictionary.cambridge.org › us › dictionary › english › null-and-void
NULL AND VOID definition | Cambridge English Dictionary
NULL AND VOID meaning: 1. having no legal force: 2. having no legal force: 3. (of an agreement or contract) having no…. Learn more.
🌐
SHABDKOSH
shabdkosh.com › dictionary › english-telugu › null › null-meaning-in-telugu
null meaning in Telugu | null translation in Telugu - Shabdkosh
The word or phrase null refers to lacking any legal or binding force, or a quantity of no importance. See null meaning in Telugu, null definition, translation and meaning of null in Telugu.
🌐
Oxford English Dictionary
oed.com › dictionary › null_adj
null, adj. meanings, etymology and more | Oxford English Dictionary
There are 13 meanings listed in OED's entry for the adjective null, one of which is labelled obsolete.
🌐
Reddit
reddit.com › r/discordapp › what does “null” mean and why is it here
r/discordapp on Reddit: What does “null” mean and why is it here
March 21, 2023 - Null is pretty much an empty placeholder in a variable it's neither empty or set with a value, in short if it showing a UI it means a dev messed up
🌐
Urban Dictionary
urbandictionary.com › define.php
Urban Dictionary: null
January 11, 2021 - Unfortunately nobody can be told what the NULL is… NULL is the value that we can not define. This is special value used in db that is given to the field when no value was assigned. In practical life we can consider it as no value.
🌐
Merriam-Webster
merriam-webster.com › word-of-the-day › null-2007-07-29
Word of the Day: Null | Merriam-Webster
July 29, 2007 - July 29, 2007 | English borrowed 'null' from the Anglo-French 'nul,' meaning 'not any.' That word, in turn, traces to the Latin word 'nullus,' from 'ne-,' meaning 'not,' and 'ullus,' meaning 'any.' '
🌐
Wiktionary
en.wiktionary.org › wiki › null
null - Wiktionary, the free dictionary
Something that has no force or meaning. (computing) The null character; the ASCII or Unicode character (␀), represented by a zero value, which indicates no character and is sometimes used as a string terminator.
🌐
Wikipedia
en.wikipedia.org › wiki › Null_(mathematics)
Null (mathematics) - Wikipedia
February 4, 2026 - In mathematics, the word null (from German: null meaning "zero", which is from Latin: nullus meaning "none") is often associated with the concept of zero, or with the concept of nothing.
🌐
Quora
quora.com › What-does-null-mean-in-shipping-packages-I-tried-checking-the-tracking-and-null-pooped-up
What does null mean in shipping packages? I tried checking the tracking and null pooped up. - Quora
Answer (1 of 2): Null is database-speak for an empty data field, and often means “data unknown” or “data not available yet”. It sometimes shows up in user interfaces. Often it would be more appropriate to just leave the field blank or ...
🌐
Quora
quora.com › What-is-the-meaning-of-null-1
What is the meaning of null? - Quora
It can have different meaning in different fields of programming. From wikipedia: * Null (SQL) (or NULL), a special marker and keyword in SQL indicating that something has no value * Null character, the zero-valued ASCII character, also des...