Answer to Question #213940 in C++ for ali

Question #213940

Answer the following short questions. Your answer should be precise.

a)     Can we declare base class constructor or destructor as virtual if yes then why we want to do?

b)    How we can declare a class as abstract and why we need abstract classes? 

c)     Why we cannot able to create objects of abstract classes give reasonable justification of that.           



1
Expert's answer
2021-07-06T00:32:45-0400

a) The constructor cannot be considered as virtual. This is because there is no virtual table in the memory when executed.

b) Abstraction is done by hiding the data implementation details, and showing only functionality to the user. Abstraction is done to focuse on what the object does instead of how it does it.

c) One can't create an object abstract class since there is an abstract method. If we create an object of abstract class, the body will give an error


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS