Previous Section  < Day Day Up >  Next Section

3.1. Introduction to a C# Class

Figure 3-1 displays a class declaration followed by a body containing typical class members: a constant, fields, a constructor containing initialization code, a property, and a method. Its purpose is to familiarize you with the syntax common to most C# classes and serve as a reference for later examples.

Figure 3-1. Class declaration and body


    Previous Section  < Day Day Up >  Next Section