Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Other Framework Types > Enumerations

Enumerations

image

The other value type in the .NET Framework is the enumeration. Unlike structures and the interfaces we’ll look at in the next section, enumerations don’t look anything like classes; they’re simply sets of constant values that are assigned meaningful names.

Let’s look at an example from that Scheduling application Neil & Gordon want us to write. It might define a method called, say, AddToSchedule, that takes the Component to be scheduled and the day of the week as parameters. There are three ways we might define the method:

image


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint