Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#covariance and contravarianceSingle-choice MCQ

Considering array covariance versus generic variance, what is the result of running this code?

object[] arr = new string[3]; arr[0] = "ok"; arr[1] = 42; Console.WriteLine(arr[0]);