What are nullable reference types (NRTs)?
Short answer
An opt-in compiler feature where reference types are non-null by default and nullability is expressed with ?, giving warnings when you might dereference null.
Advertisement
AModel answer
An opt-in compiler feature where reference types are non-null by default and nullability is expressed with ?, giving warnings when you might dereference null.
string name = "x"; // must not be null
string? middle = null; // may be nullReal-world example
Catching potential NullReferenceExceptions at compile time instead of in production.