Complete the code to declare a value type variable stored on the stack.
int [1] = 10;
The variable number is a simple integer stored on the stack because it is a value type.
Complete the code to create a reference type object stored on the heap.
string [1] = "hello";
The variable text is a reference type (string) stored on the heap.
Fix the error in the code to correctly allocate an object on the heap.
MyClass obj = [1] MyClass();The keyword new is required to create an object on the heap in C#.
Fill both blanks to create a dictionary that maps keys to values stored on the heap.
var dict = new Dictionary<[1], [2]>();
The dictionary uses string keys and object values, both reference types stored on the heap.
Fill all three blanks to create a list of objects and add a new object to it.
List<[1]> list = new List<[2]>(); list.[3](new MyClass());
AddRange instead of Add for a single item.The list holds object types, and the Add method adds a single new object to the list.