Abstraction is an important feature of any object-oriented programming language. Abstraction involves extracting only the relevant information. Abstraction doesn't mean that information is unavailable. In other words all the information exists but only the relevant information is provided to the user.
Abstract class
C# enables us to create abstract classes that are used to provide partial class implementation of an interface. We can complete an implementation using the derived classes. Abstract classes contain abstract methods, which can be implemented by using abstract classes and virtual functions.
There are certain rules governing the use of abstract class. These are:
- Cannot create an instance of an abstract class.
- Cannot declare an abstract method outside an abstract class.
- Cannot be declared sealed. (Sealed classes can never be inherited.)
The syntax to declare a class Abstract is:
abstract class classname
{
..........
}
Abstract methods
Abstract methods are the methods without any body. The implementation of an abstract method is done by the derived class. When a derived class inherits the abstract method from the abstract class, it must override the abstract methods.
The syntax for using the abstract method is:
[access-modifier] abstract <return-type> <method-name([parameters])>
The following code illustrates the use of an Abstract method:
using System;
namespace abstractclass
{
abstract class baseclass
{
publicabstract void m1();
}
class derived:baseclass
{
public override void m1()
{
Console.WriteLine("success");
}
}
public class implement
{
static voidMain(string[] args)
{
derived ob =new derived();
ob.m1();
Console.Read();
}
}
}
In the above code example, the abstract method is declared by adding the abstract modifier to the method. Abstract method m1() is declared in the abstract class named "baseclass". The abstract method is inherited in a "derived" class. Abstract methods cannot contain a method body.

Ariel JimenezPosted Oct 3, 2025, 11:36 AM
Thanks for the info.
Thirumalarao ThotapalliPosted May 16, 2020, 2:23 PM
Sorry I am not agree with you
Thirumalarao ThotapalliPosted May 16, 2020, 2:22 PM
I am not agree
Guest UserPosted Aug 6, 2019, 12:12 PM
Thanks. I was unclear from 3 years with this topic and you cleared in 10 minutes. Thanks
Prashanth VunnamPosted Oct 9, 2018, 10:26 PM
Change the title from abstraction to abstract class
Azeem attariPosted Mar 26, 2018, 3:13 PM
Thanks for share Informative Knowledge.
Nanda Kishore ChandrapatiPosted Feb 23, 2018, 10:24 AM
Totally wrong. this is abstract class concept. not abstraction concept. please don't follow this...
Faizan AhmedPosted Jan 14, 2014, 1:09 PM
interface and Abstract classes are alike, there are few differences between both of them. The term Abstraction means "the quality of dealing with ideas rather than events" and as we have seen, we discussed ideas(methods those were declared only not defined) and implemented their events on derived classes.Kindly refer to this definition first: Abstraction is "the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use" (Richard Gabriel).
PrahaladPosted Jan 12, 2013, 1:46 AM
abstract class comes under polymorphism and not abstraction..
PrahaladPosted Jan 12, 2013, 1:34 AM
This is entirely wrong...the topic is all about abstraction and not about abstract class...ABSTRACTION is achieved only with interface concept...see to it you modify this completely..
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Prakash KaruppiahPosted Nov 28, 2012, 11:44 PM
Nice explanation
Smart LuckyPosted May 2, 2012, 3:12 AM
nice
Satyapriya NayakPosted Oct 13, 2010, 12:22 PM
Hi faizan, Well explained in simple words. Thanks