What is the difference between value types and reference types in C#?
Value types (struct, enum, primitives) live on the stack or inline in their container and are copied on assignment. Reference types (class, interface, delegate, array) live on the heap and assignment copies the reference, not the data.
int a = 5; int b = a; b = 10; // a still 5
var x = new List<int> { 1 }; var y = x; y.Add(2); // x and y both [1, 2]