July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Chapter 4, “Data Types and Expressions,” introduced the null-propagating operator and you saw how you can use it against reference types to check whether an object is null before you use it. With value types, things are different. In fact, as you may recall, value types do not return Nothing but instead return a default value. For instance, the default value for the Integer type is 0. For this reason, you do not need to use the null-propagating operator against a value type directly. However, the null-propagating operator is very useful when you want to check whether an object exposing a property as a value type is not null. To better understand this, consider the following Person class, which exposes ...