C#实施多个接口
示例
public interface IAnimal{
string Name { get; set; }
}
public interface INoiseMaker
{
string MakeNoise();
}
public class Cat : IAnimal, INoiseMaker
{
public Cat()
{
Name = "Cat";
}
public string Name { get; set; }
public string MakeNoise()
{
return "Nyan";
}
}
以上是 C#实施多个接口 的全部内容, 来源链接: utcz.com/z/330646.html