liveBook · Manning

Non-nullable type

A non-nullable type is a type whose values are statically constrained not to include the null value.

How 2 Manning books explain it

Kotlin in Action, 2E

A non-nullable type is a Kotlin type whose values are not permitted to be null by the type system.

How it is used
Establishes compile-time boundaries between required values and values that may be absent.
How deep it goes
Explains declarations, smart casts, subtyping, generics, delayed properties, and Java overrides without detailing generated checks further.
Examples
Uses string-length functions, email sending, generic processors, Java interface overrides, and JUnit-style service setup.
What you can do after
Apply it by declaring required values non-nullable and converting nullable values only after an explicit safe path.

Read how Kotlin in Action, 2E explains non-nullable type →

Pro ASP.NET Core 7, Tenth Edition

A non-nullable variable is a variable whose type does not permit the special null value.

How it is used
Prevents null reference mistakes by making permitted null states explicit and turning violations into compiler warnings.
How deep it goes
Explains declarations, required initialization, defaults, and array nullability, including how element and container annotations differ.
Examples
Uses Product.Name, Product arrays, Kayak and Lifejacket objects, null elements, required initializers, and string.Empty defaults.
What you can do after
Apply nullable annotations, required members, and defaults to make C# object and collection null behavior compile-time explicit.

Read how Pro ASP.NET Core 7, Tenth Edition explains non-nullable type →

Also covered in

What to know first

Related concepts

Questions about non-nullable type

What is non-nullable type?

A non-nullable type is a type whose values are statically constrained not to include the null value.

Which Manning books explain non-nullable type?

Kotlin in Action, 2E and Pro ASP.NET Core 7, Tenth Edition.

What should I know before learning non-nullable type?

Manning books that teach non-nullable type usually introduce attribute, missing value, nullable annotation and option first.

What is the difference between non-nullable type and option?

A non-nullable type is a type whose values are statically constrained not to include the null value. An option type is a type that represents either a value of a specified type or its absence as distinct alternatives.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.