Can we create the instance for abstract classes
No, you cannot create an instance of an abstract class because it does not have a complete implementation. The purpose of an abstract class is to function as a base for subclasses. It acts like a template, or an empty or partially empty structure, you should extend it and build on it before you can use it.
When you try to compile the above code, you will get the Error message like: "Cannot create an instance of the abstract class or interface" .
Abstract Class and Interface
An Abstract class without any implementation just looks like an Interface. The choice of whether to design your functionality as an interface or an abstract class can sometimes be a difficult one. However, there are lot of differences than similarities between an Abstract class and an Interface. More about.... Difference between Abstract Class and Interface
- What is a Class?
- What is an Object?
- Constructors and Destructors
- What Is Inheritance ?
- What are the different types of inheritance ?
- What are Access Modifiers ?
- Why Classes cannot be declared as Protected?
- Can we declare private class in namespace
- Difference between Classes and Structures
- Can we use pointers in C# ?
- Can you prevent your class from being inherited
- Difference between method Overloading and Overriding
- Difference between Early Binding and Late binding
- What is nested class
- What is partial class ?
- What is Virtual Method
- Difference between class and object
- What is Data Encapsulation?
- Object Based Language and OOPs