Summary
This chapter examined C# syntax for declaring
and manipulating objects. You have seen how to declare static and
instance fields, properties, methods, and constructors. You have
also seen that C# adds some new features not present in the OOP
model of some other languages: static constructors provide a means
of initializing static fields, whereas structs allow you to define
high-performance types, albeit with a more restricted feature set,
which do not require the use of the managed heap. You have also
seen how all types in C# derive ultimately from the type
System.Object, which means that all
types start with a basic set of useful methods, including
ToString().
Chapter 4, “Inheritance,” examines
implementation and interface inheritance in C#.