The Built-In Members of the Object Type

Object itself provides several basic methods and properties, which each new class automatically inherits. The developers of the .NET Framework have thus made sure that each object has specific basic functionality that other classes can count on.

Returning the String Representation of an Object with ToString

The ToString method returns a string that “describes” a class instance. Primitive variables, for example, use the ToString method to convert their values into strings—usually even with formatting options. You know that the ToString method is the first point of reference for the implementation of simple polymorphous behavior. You only need to override the ToString method of a class, and leave it to the class ...

Get Microsoft® Visual Basic® 2010 Developer’s Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.