13.3. Object Class

In addition to the String class, there are several other classes that deserve special mention in the C# language—one such class is the Object class. The Object class is at the very root of the .NET class hierarchy. Every other .NET type, from the simple predefined value types, to strings, to arrays, to predefined reference types, to user-defined types, ultimately derives from the Object class.

Inheritance from the Object class is implicit; there is no need to include the syntax in a class definition:

: Object

That is, the class definition syntax

public class Student {...}

is equivalent to the more explicit

public class Student : Object {...}

The Object class is contained in the System namespace, but as with the String class ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.