enum

Applying What We Have Learned So Far

johnmora's picture

The following code is from a Visual Studio 2008 C# Console application named CreateStruct. The code is from the Program.cs file. It illustrates what we have read until now, in a working application. The output of the Console application when run will be “John Mora (Male), age 32, 1234567890, Home”. If you ran this application and did not have read permissions on C:\boot.ini you would get an exception. The “[Serializable]” attribute allows the Manager class (which derives from the Person class) to be serialized, which will be covered later.

Chapter 1: Lesson 1: Using Value Types

johnmora's picture

Value types are variables which contain their data directly as opposed to reference types  which store only a reference to the data stored elsewhere. Instances of value types are stored in an area of the memory called the “stack” where the runtime can manipulate them quickly with minimal overhead.

Powered by Drupal - Design by artinet