Q:

Properties in interfaces c#

How you can have properties in an interface if an interface isn't supposed to have attributes in C#,as properties are getters and setters for attributes? At the class we had this example and i thought an interface should only have method declarations.
interface IKnownProgrammingLanguages
{
    string[] ProgrammingLanguages { get; set; }
}

A:

Properties are just a nicely looking function declarations. Beneath the sugar, they look something like this:
interface IKnownProgrammingLanguages
{
    void SetProgrammingLanguages(string[] value);
    string[] GetProgrammingLanguages();
}

Interfaces aren't supposed to have attributes because implementing classes can't change the behavior of the attributes - they always work the same way. But each implementing class can define how the SetProgrammingLanguages and GetProgrammingLanguages operate, that's why they are allowed, and often useful.

