what is the size of an abstract class and why can’t we create objects of an abstract class?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because otherwise it wouldn’t be “abstract”. The whole point of an abstract base class is that it is not meaningful to instantiate it; instead one must define derived subclasses, and instantiate them instead.
Abstract classes, therefore, have no size (but that’s not to say that they don’t contribute to the size of its derived subclasses).