Struct implementing interface C# with Example



Struct implementing interface C# with Example

public interface IShape 
{ 
decimal Area(); 
} 
public struct Rectangle : IShape 
{ 
public decimal Length { get; set; } 
public decimal Width { get; set; } 
public decimal Area() 
{ 
return Length * Width; 
} 
} 
 

0 Comment's

Comment Form

Submit Comment