stack

Chapter 1: Lesson 2: Using Common Reference Types

johnmora's picture

Reference types store an address of their data, aka “pointer” on the portion of the memory called the “stack”. The actual data to which the pointer refers to is stored in an area of memory called the “heap”. Because reference types directly store the address “pointer” to the data rather than the data itself, assigning one reference variable to another doesn’t copy the data over. Instead, it merely creates a second copy of the “pointer”, which also refers to the same memory on the heap as the original.

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