O'Reilly logo

Introducing Visual C# 2010 by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Fields

A field is a variable that is associated with a class or with an instance of a class, and the set of fields contained with a class collectively represent an object's state. In this chapter, we'll explore the definition and use of fields, how to expose your fields to other classes directly and through properties, and the different modifiers you can use to change the way that your field works.

Fields are really important; they are at the heart of classes and are closely related to properties and methods (which I cover in Chapters 8 and 9, respectively). Without fields, we'd have no way to differentiate objects from one another and no basis on which to reflect the progression of our programs. Table 7-1 provides the summary for this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required