Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC#value vs reference typesSingle-choice MCQ

A struct Point has a public int field X. You store a Point in a List and then try to change a field on it in place. What does this print?

struct Point { public int X; } var list = new List<Point> { new Point { X = 1 } }; list[0].X = 5; Console.WriteLine(list[0].X);