What is an abstract class?

What is an abstract class?

Abstract class:-Use the abstract modifier in a class declaration to indicate that a class is intended only to be a base class of other classes.

Abstract classes have the following features: 

1-An abstract class cannot be instantiated. 
2-An abstract class may contain abstract methods and accessors. 
3-It is not possible to modify an abstract class with the sealed modifier, which means that the class cannot be inherited. 
4-A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors. 
Abstract class have complete and non complete member and methods.
Example:- abstract class a
{
int a;
public abstract void print();
}

By:kamal
Date:2013-10-10 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Links

C interview questions and answers for experienced and fresher