Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#reflection and attributesSingle-choice MCQ

What does the following reflection code print?

public class Sample { public int Value { get; private set; } = 5; } var prop = typeof(Sample).GetProperty("Value"); Console.WriteLine(prop.CanWrite); Console.WriteLine(prop.GetSetMethod() == null);