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
What are methods in C#?
Why do we need constructor in c#?
What is the default modifier for class in c#?
What are predicates in c#?
How string definitions will prevent escaping on backslashes in C#?
Can we overload indexer in c#?
What are the ways in which client can create object on server in cao model?
Is class reference type c#?
What can be done with c#?
Why do we use static methods in c#?
Are c# generics the same as c++ templates?
How do you read an Excel sheet in C#?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?
What does dbml mean?
explain the three services model commonly know as a three-tier application.