Created
March 26, 2014 20:32
-
-
Save hazzik/9792684 to your computer and use it in GitHub Desktop.
LSP.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Rectangle { | |
| public Rectangle(decimal width, decimal height) { | |
| Width = width; | |
| Height = height; | |
| } | |
| public decimal Area() { | |
| return Width * Height; | |
| } | |
| public decimal Width { get; private set; } | |
| public decimal Height { get; private set; } | |
| } | |
| public class Square : Rectangle { | |
| public Square(decimal side) | |
| : base (side, side) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment