O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Nothing

You’d think writing about “nothing” wouldn’t take very long, because there’s nothing to write. But writing about nothing in Visual Basic or .NET is more than nothing—a lot more!

Nothing as a Null Reference Pointer

Using the knowledge you gained in Chapter 7, you can figure out for yourself why an object variable can have the value Nothing (null in C#—just for the sake of thoroughness). When you create an instance of a class by using New, you need to assign this instance (or more specifically, the address of this instance) to the object variable. Only then can you access the public fields, properties, and methods of the class instance (of the object) via the object variable, as illustrated in Figure 8-8.

Figure 8-8. When you access class elements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required