Skip to Main Content
Visual Basic 2015 Unleashed
book

Visual Basic 2015 Unleashed

by Alessandro Del Sole
July 2015
Intermediate to advanced content levelIntermediate to advanced
1300 pages
87h 27m
English
Sams
Content preview from Visual Basic 2015 Unleashed

The Null-Propagating Operator and Value Types

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Visual Basic 2015

Beginning Visual Basic 2015

Bryan Newsome

Publisher Resources

ISBN: 9780134196664Purchase book