Multiple choice technology operating systems

Where are reference types typically allocated

  1. Reference on Stack

  2. Reference on Heap

  3. Reference on Stack and the Data it points to on Heap

  4. None of the Above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

For reference types in C#, the reference variable itself is stored on the stack (holding the memory address), whereas the actual object instance and its data are allocated on the garbage-collected heap.