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 we inherit partial class in c#?

0 Answers  


What is serialization in c#?

0 Answers  


What is a di class?

0 Answers  


Will finally block get executed if the 1exception had not occurred?

3 Answers  


How To Maintain Transaction In C#?

1 Answers   Phoenix Technologies,






What are the properties of a string class?

0 Answers  


Define a manifest in .net?

0 Answers  


What is stringwriter c#?

0 Answers  


What is escape sequence in c#?

0 Answers  


Difference between direct type casting and using "as" keyword?

1 Answers   TCS,


List out the differences between array and arraylist in c#?

0 Answers  


Which class does the remote object has to inherit?

0 Answers  


Categories