Mid OOP

Can you have properties in both interfaces and abstract classes?

  • Yes, both can define properties.
  • Interface properties are abstract by default; abstract class properties can have

implementation.

interface ICar { int Speed { get; set; } }

abstract class Vehicle { public int Speed { get; set; } }

More from C# Programming Tutorial

All questions for this course