Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#boxing and unboxing costSingle-choice MCQ

What is the boxing behavior of this loop, and where do allocations happen?

int sum = 0; IComparable c; for (int i = 0; i < 3; i++) { c = i; sum += c.CompareTo(0); }