This chapter explained C# constructs for classes and object orientation in C#. This included a discussion of fields, and a discussion of how to access them on a class instance. Whether to store data on a per-instance basis or across all instances of a type was a key concept discussed. Static data is associated with the class and instance data is stored on each object. The chapter explored encapsulation in the context of access modifiers for methods and data. The C# construct of properties was introduced, and you saw how to use it to encapsulate private fields. The next chapter focuses on how to associate classes with each other via inheritance, and the benefits derived from this object-oriented construct. |