Created
November 9, 2022 22:22
-
-
Save hsynkrcf/e2d992934d41cb405b3852ddf50b37b8 to your computer and use it in GitHub Desktop.
OCP
This file contains 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 Phone | |
{ | |
public PhoneType Type { get; set; } | |
} | |
public enum PhoneType | |
{ | |
Iphone, | |
Samsung | |
} | |
public class Iphone : Phone | |
{ | |
public Iphone() | |
{ | |
this.Type = PhoneType.Iphone; | |
} | |
} | |
public class Samsung : Phone | |
{ | |
public Samsung() | |
{ | |
this.Type = PhoneType.Samsung; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment