Abstract Class and Interface
Abstract Class and Interface
Abstract Class
• Abstract Classes are the way to achieve
abstraction in C#.
• Abstraction in C# is the process to hide the
internal details and showing functionality only.
• Abstraction can be achieved by two ways:
– Abstract Class
– Interface
• Abstract class and interface both can have
abstract methods which are necessary for
abstraction.
Abstract Method
• A method which is declared abstract and has
no body is called abstract method.
• It can be declared inside the
abstract class only.
• Its implementation must be provided by
derived classes.
• For example:
public abstract void draw();
Abstract Method