Values & References1 / 14
Up next

Passing a reference type

// the reference is copied, but it still points at one list
void Fill(List<int> list) => list.Add(42);

var nums = new List<int> { 1 };
Fill(nums);
Console.WriteLine(nums.Count);
What you're solving

the callee mutates the same object