What is a property in C# and how does it differ from a field?

Answer

A field is a variable declared directly in a class: private int _age; — raw storage. A property is a member that provides a flexible mechanism to read, write, or compute the value of a private field. Properties look like fields to callers but are actually method pairs (get accessor / set accessor). Auto-property: public string Name { get; set; } — compiler auto-generates the backing field. Expression-bodied property: public string FullName => $"{FirstName} {LastName}";. Init-only setter (C# 9): public string Id { get; init; } — settable only in constructors and object initializers. Properties are preferred over public fields because: they support validation, can be abstract/virtual (for polymorphism), enable data binding in frameworks, and allow changing the implementation without breaking the API.