Read-only computed properties have a get accessor that returns a calculated value.
Step 2: Check options
public int Area { get => Width * Height; } correctly uses get accessor with expression. public int Area { set => Width * Height; } wrongly uses set accessor. public int Area { get; set; } = Width * Height; uses auto-property with initializer, which is not computed. public int Area() => Width * Height; is a method, not a property.
Final Answer:
public int Area { get => Width * Height; } -> Option B
Quick Check:
Read-only computed property = get accessor only [OK]
Quick Trick:Use get accessor for read-only computed properties [OK]
Common Mistakes:
MISTAKES
Using set accessor in computed property
Confusing methods with properties
Using auto-properties with initializers incorrectly
Master "Properties and Encapsulation" in C Sharp (C#)
9 interactive learning modes - each teaches the same concept differently