Locked lesson.
About this lesson
We explain the concept of Null, discuss which fields can have a null value, and introduce Nullables.
Exercise files
Download this lesson’s related exercise files.
9 - Null Nullables.docx60.8 KB 9 - Null Nullables SOLUTION.docx
57.8 KB
Quick reference
Null / Nullables
Null is basically just nothing.
When to use
Use it when you need to represent nothing.
Instructions
string myName = null;
Nullables allow you to convert an integer to a null.
Nullable<int> myInt = null;
Hints & tips
- Strings can be null
- Integers cannot be null
- string myName = null;
- Nullable<int> myInt = null;
Lesson notes are only available for subscribers.