Why we can't create the object of abstract class ?

Answers were Sorted based on User's Feedback



Why we can't create the object of abstract class ?..

Answer / ian

The reason behind this is , the abstract class contains
abstract methods which cant do any job. Calling such
function is meaningless. So it is not allowed to
instantiate abstract class

Is This Answer Correct ?    63 Yes 35 No

Why we can't create the object of abstract class ?..

Answer / vijay

Hello all am vijay

I can say most of the above answers are partially correct
but not upto the mark.

The exact reason is .

The function address of the pure virtual function is not
put into VTABLE of the abstract class , hence VTABLE of the
abstract is incomplete.
So when the user tries to create an instance of the
abstract class the compliler will throw an error.

Is This Answer Correct ?    32 Yes 7 No

Why we can't create the object of abstract class ?..

Answer / abhishek ajmera

When we declare a pure virtual function like this:-

Virtual PureVirtualFunction()=0;

This indicates compiler to reserve a slot for Function in VTABLE but don’t put an address in that particular slot. If only one function in a class is declared as pure virtual, the VTABLE is incomplete.
If the VTABLE for a class is incomplete, compiler cannot safely create an object of a pure abstract class, so you get an error message from the compiler if you try to make an object of a pure abstract class. Thus, the compiler ensures the purity of the abstract class, and you don’t have to worry about misusing it.

Is This Answer Correct ?    10 Yes 1 No

Why we can't create the object of abstract class ?..

Answer / mallikharjun d

Hi frnds..the simple answer for this question is..
we cant create object for an abstract class bcz abstract class should be inherited to derived class, due to that reason we can access abstract members using derived class object..

Is This Answer Correct ?    3 Yes 0 No

Why we can't create the object of abstract class ?..

Answer / talk

Because object means it will occupy memory and 'do something'
but what exactly it will do ?? it is not told in an abstract
class as because there is only abstract methods declared but
not defined. Therefore, there is not meaning to create an
object which does not have any definition.

Is This Answer Correct ?    3 Yes 1 No

Why we can't create the object of abstract class ?..

Answer / rajesh kamble

abstract class contain one or more pure vertual
function ,this types of class contain only the declaration
of method ,it do not have defination of any method,when we
define any abstract class object it not allocate the memory
to any object , and when any object of class will created
it first initialise memory for class and then methods. and
look for the defination for that, for that point of view
when we create object of any abstract class method
defination will not present and memory cannot be allow to
object. any by the compiler it cause the error.

Is This Answer Correct ?    8 Yes 7 No

Why we can't create the object of abstract class ?..

Answer / santosh bind

Abstract Class Contain a method without or a body empty implemantation. so we can not create the object of abstract Class.

Is This Answer Correct ?    1 Yes 0 No

Why we can't create the object of abstract class ?..

Answer / uday eshkilla

simple answer is, we can't create the object of abstract class, because they contain only abstract members, any abstract class can not have implements it is basically incomplete…

Is This Answer Correct ?    2 Yes 2 No

Why we can't create the object of abstract class ?..

Answer / srikanth

If we define a class with abstract keyword then the class
will be abstract class irrespective of abstract methods(un
inplemented methods)every one know that.

While compilation compiler checks whether the class is
abstract or not? if it's abstract it gives the compilation
error...

Is This Answer Correct ?    2 Yes 6 No

Why we can't create the object of abstract class ?..

Answer / nitin

Becoz It is Design to act as a base class

Is This Answer Correct ?    9 Yes 14 No

Post New Answer

More C Sharp Interview Questions

Can a structure inherit a class.

3 Answers   Infosys, Synechron,


What is the difference between cookies and session?

7 Answers   ADITI, Infinity, Infotech, VBV, Web Connect,


What is anonymous class in c#?

0 Answers  


List down the fundamental oop concepts?

0 Answers  


What is garbage collection? How to force garbage collector to run?

0 Answers  






Can mvc be used for desktop applications?

0 Answers  


Which CSS property can be used for controlling the stretchiness of a control?

1 Answers   TCS,


What is .net console?

0 Answers  


Why do we need escape characters?

0 Answers  


What is the difference between yield and return?

0 Answers  


What is extension method in c sharp?

0 Answers  


Which is the best way for keeping the data in XML or SQL server..and why?

8 Answers   Infosys, Satyam,


Categories