Nullability is the question if a type allows the value null or not. The compiler tracks nullability, which eliminates a host of errors.
A variable of a non-nullable type has to be assigned an initial value.
For example, Date is nullable, while int is non-nullable.
So:
var a : Date; // this is OK var b : Date = null; // this is also OK var c : int; // ERROR, has to be assigned a value var d : int = null; // also ERROR, int cannot be null var e : int = 7; // this is OKOnly the built-in types
int, float, boolean and string are non-nullable. All other types (including user defined classes and types), are nullable by default.
It is however possible to make a type non-nullable by prefixing with a "!".:
var x : !Date = new Date(); // x cannot be null! x = null; // ERROR
And, correspondingly, a non-nullable type can be declared nullable by prefixing with a ?:
var x : ?int = 7;
