Language syntax

null literal

The null reference literal. It can be assigned to reference types, but not primitive types.

Formal Syntax & Structure

java syntaxjava
null

Working Example

Example Snippetjava
public class Main {    public static void main(String[] args) {        String item = null;        System.out.println(item == null);    }}
Java Reference