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 toint32 c#?

618


What does exclamation mark mean in access query?

547


What are properties in C#?

538


What are the methods in c#?

522


What is the difference between internal and private in c#?

499






What is the use of constructor in c# with example?

425


Is it possible to inherit multiple interfaces?

539


How can you prevent escaping on backslashes in C# with string definitions?

693


To create a localized application which namespaces are necessary?

519


Can datetime be null c#?

482


Define Final Class in C#

542


Which is better interface or abstract class in c#?

439


What can we do to handle multiple exceptions?

551


What is executenonquery c#?

461


What is variable and its classification?

524