go-v.orgcodex
Menu
Page tools

codex · Philosophy

Nullable type

Nullable types are a feature of some programming languages which allow a value to be set to the null value instead of the usual possible values of the data type. In statically typed languages, a nullable type is an option type, while in dynamically typed languages (where values have types, but variables do not), equivalent behavior is provided by having a single null value. The null value is frequently used to represent a missing value or invalid value, such as from a function that failed to return or a missing field in a database, as in NULL in SQL. In other words, the null value is undefined.

Primitive types such as integers and Booleans cannot generally be null, but the corresponding nullable types (nullable integer and nullable Boolean, respectively) can also assume the null value. This can be represented in ternary logic as false, null, true as in three-valued logic. In languages with nullable types, a nullable type is usually contrasted with a non-nullable type, or a "null-safe type".

Wikipedia contributors, "Nullable type", Wikipedia, revision 1385088826, retrieved 20 November 2026, source, CC BY-SA 4.0.

More Philosophy · Search the codex