Chapter 4. Type Fundamentals

In this chapter:

All Types Are Derived from System.Object

Casting Between Types

Namespaces and Assemblies

How Things Relate at Run Time

In this chapter, I will introduce information that is fundamental to working with types and the common language runtime (CLR). In particular, I’ll discuss the minimum set of behaviors that you can expect every type to have. I’ll also describe type safety, namespaces, assemblies, and the various ways you can cast objects from one type to another. Finally, I’ll conclude this chapter with an explanation of how types, objects, thread stacks, and the managed heap all relate to one another at run time.

All Types Are Derived from System.Object

The runtime requires every type to ultimately be derived ...

Get CLR via C#, Fourth Edition 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.