Abstract Class:
-
An abstract class is a class that cannot be instantiated .i.e an class whose object cannot be made, trying to do so gives compile time error.
Above shown is the error when trying to create an object (obj) of an abstract class Class1
-
An abstract class is a class that can only be inherited by another class
public abstract class Class1
{
}
public class class2 : Class1
{
}
here Cass2 inherits Class1
-
An abstract method is a method with abstract keyword and with out any body or implementation of the method
public abstract class Class1
{
public abstract void add();
// add is an abstract method which is with out body its only the definition of the method
}
-
an abstract method can not be private it has to be public, protected or internal
-
there can be any number of abstract method in a abstract class
-
an abstract method can not be written for non abstract class
-
an abstract class can have other methods also which are not abstract methods
public abstract class Class1
{
public abstract void add();
private void sub()
{
}
}
5.When an abstract class is inherited by another class ,the derived class which is inheriting the abstract class must have the implementation of the abstract method with override key word other wise it will give a compile time error as shown below

Upendra Pratap ShahiPosted Sep 30, 2015, 3:38 AM
good one..
Nikhil KumarPosted Jan 9, 2010, 9:52 AM
Nice one !