Object

We kept one of the most interesting types for the last: System.Object, otherwise known as object in C#. What’s so special about this one? Recall that the .NET Framework is based on the principles of object-oriented programming (OOP). In this setting, types form a hierarchy; we pay much more attention to OOP in later chapters.

Every type in .NET, except for System.Object, has a base type from which it inherits code as well as data. This sentence already gives it away. Because System.Object doesn’t have a base type, it should necessarily be the (only) root of the type hierarchy. Although this might sound of interest only for theoretical purposes, it has a very practical side to it: unifying the type system across value and reference types. ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

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