Created
November 10, 2022 00:27
-
-
Save hsynkrcf/07e67f02d4e4a09cbdb8707328ca951a to your computer and use it in GitHub Desktop.
YES 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 abstract class Phone | |
{ | |
public abstract void Make(); | |
} | |
public class Iphone : Phone | |
{ | |
public override void Make() | |
{ | |
Console.WriteLine("Iphone Created\n"); | |
} | |
} | |
public class Samsung : Phone | |
{ | |
public override void Make() | |
{ | |
Console.WriteLine("Samsung Created\n"); | |
} | |
} | |
public class Xiaomi : Phone | |
{ | |
public override void Make() | |
{ | |
Console.WriteLine("Xiaomi Created\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment