为什么一个人不能实例化一个抽象类的对象 [英] Why can't one instantiate an object of an abstract class

查看:80
本文介绍了为什么一个人不能实例化一个抽象类的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
为什么不能实例化抽象类的对象?
提供编译器的语句视图.

感谢您的时间!您必须创建一个基于抽象思想的真实类,才能实例化它.这与编译器无关,它是 C ++编程语言 [ ^ ].


以下是在Wikipedia上发现的一种独立于语言的良好语言: http://en.wikipedia.org/wiki/Abstract_type [^ ].

最好的问候,

—MRB


C ++中的抽象类没有足够的信息来实例化有效对象.
阅读此链接以获取更多详细信息: http://msdn.microsoft.com/en-us/library/c8whxhf1 .aspx [ ^ ]


Hi!
Why can''t one instantiate an object of an abstract class?
Give compiler view of statement.

Thanks for your time!

解决方案

Because it is abstract which in simple terms means not real, or an imaginary thing. you have to make a real class that is based on the abstract ideas to be able to instantiate it. This has nothing to do with the compiler, it is one of the rules of The C++ Programming Language[^].


Here is a good language independant descritpion found on Wikipedia: http://en.wikipedia.org/wiki/Abstract_type[^].

Best Regards,

—MRB


An abstract class in C++ does not have enough information to instantiate a valid object.
Read this link for more detail: http://msdn.microsoft.com/en-us/library/c8whxhf1.aspx[^]


这篇关于为什么一个人不能实例化一个抽象类的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆