Can we create instance for Abstract class?

Answer Posted / rupali

we cant make object of abstract class becoz, in the vtable the vtable entry for the abstract class functions will be NULL, which ever are defined as pure virtual functions...

even if there is a single pure virtual function in the class the class becomes as abstract class..

if there is a virtual function in your class the compiler automatically creates a table called virtual function table .. to store the virtual function addresses.... if the function is a pure virtual function the vtable entry for that function will be NULL.

even if there is a single NULL entry in the function table the compiler does not allow to create the object.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a thread? What is multithreading?

716


What is difference between c sharp and c#?

655


What do u mean by delegation of authority?

719


write a program to find the biggest palindrome in the given string

738


What does return do in unity?

707


What is system console writeline in c#?

663


What is the difference between parse and tryparse in c#?

703


Why do I get a security exception when I try to run my c# app?

761


Why singleton is sealed?

643


Is php easier than c#?

663


What do you mean by synchronous and asynchronous operations?

698


What are immutable types in c#?

675


What are concrete classes?

657


Explain data types in c#?

717


Describe the types of comments in c#?

690