Для чего нужны интерфейсы (не GUI) - C#
Формулировка задачи:
Пожалуйста, объясните новичку, для чего нужны интерфейсы! Желательно с простыми примерами для понимания.
Решение задачи: «Для чего нужны интерфейсы (не GUI)»
textual
Листинг программы
interface IЧеловек
{
string Name {get;set;}
string Surname{get;set;}
string Sex{get;set;}
int Age{get;set;}
DateTime Birthday{get;set;}
}
class Сотрудник : IЧеловек
{
#region Члены IЧеловек
public string Name
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string Surname
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string Sex
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public int Age
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public DateTime Birthday
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
#endregion
}