Skip to main content
An abstract property in C# is a property declaration that provides no implementation and acts as a strict architectural contract. It mandates that any non-abstract derived type must provide the concrete implementation for the property’s defined accessors (get, set, or init). When inheriting from an abstract class, this implementation is provided using the override modifier.

Syntax and Implementation

An abstract property is defined using the abstract keyword. Its accessors end with a semicolon rather than a code block.

Core Mechanics and Compiler Rules

  • Declaration Context: Abstract properties can be declared inside classes explicitly marked with the abstract modifier. Since C# 8.0 (Default Interface Methods), properties inside interfaces can also be explicitly marked with the abstract keyword.
  • No Body: The base declaration cannot contain any logic. Writing get { return 0; } on an abstract property will result in a compiler error.
  • Mandatory Implementation: Any concrete (non-abstract) class inheriting from the base type is required by the compiler to implement the abstract property. For abstract base classes, this requires the override keyword.
  • Signature Matching: The overriding property in the derived class must exactly match the type, name, and access modifiers of the abstract property.
  • Accessor Parity: The derived class must implement exactly the accessors defined in the base abstract property.
    • If the abstract property defines only a get accessor, the derived class must provide only a get accessor. Attempting to add a set accessor to the overridden property results in compiler error CS0546 (cannot override because it does not have an overridable set accessor).
    • If the abstract property defines both get and set, the derived class must implement both.
  • Accessor Accessibility: If an abstract property restricts the visibility of a specific accessor (e.g., public abstract int Value { get; protected set; }), the overriding property must enforce the exact same visibility modifier on that specific accessor.
Tired of Poor C# Skills? Fix That With Deep Grasping!Learn More