Implementing multiple interfaces C# with Example



Implementing multiple interfaces C# with Example

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"; 
} 
} 

0 Comment's

Comment Form

Submit Comment