Nullable type

Nullable types are a feature of some programming languages which allow a value to be set to the special value NULL instead of the usual possible values of the data type. In statically typed languages, a nullable type is an option type[citation needed], while in dynamically typed languages (where values have types, but variables do not), equivalent behavior is provided by having a single null value.

NULL 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 NULL 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.[jargon][citation needed] This can be represented in ternary logic as FALSE,NULL,TRUE as in three-valued logic.


© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search