继承与多态性 [英] Inheritance & polymorphism
本文介绍了继承与多态性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我只是想知道,在Java中有一个名为instanceOf的运算符,
在c ++中是等价的吗?
先谢谢所有人。
解决方案
" placid" <卜**** @ gmail.com>在消息中写道
news:11 ********************** @ g44g2000cwa.googlegr oups.com ...大家好,
我只是想知道,在Java中有一个名为instanceOf的运算符,
在c ++中是等价的吗?
提前致谢对所有人来说。
最接近的等价物是dynamic_cast(指针变体),但是它/ b $ b类似于C#'s"超过它的实例。
-
David Hilsee
placid写道:大家好,
我只是想知道,在Java中有一个名为instanceOf的运算符,
在c ++中是等价的吗? / blockquote>
C ++简介。
David Hilsee写道:placid <卜**** @ gmail.com>在消息中写道
新闻:11 ********************** @ g44g2000cwa.googlegr oups.com ...大家好,
我只是想知道,在Java中有一个名为instanceOf的运算符,
在c ++中是等价的吗?
先谢谢所有人。
最接近的等价物是dynamic_cast(指针变体),但它类似于C#'s""比它实例更多。
还有另一种方法,然后是dynamic_cast吗?
-
David Hilsee
Hi all,
I was just wondering, in Java there is an operator called instanceOf,
whats the equivalent in c++?
Thanks in advance to all.
解决方案"placid" <Bu****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...Hi all,
I was just wondering, in Java there is an operator called instanceOf,
whats the equivalent in c++?
Thanks in advance to all.
The closest equivalent is dynamic_cast (the pointer variant), but it
resembles C#''s "as" more than it does instanceof.
--
David Hilsee
placid wrote:Hi all,
I was just wondering, in Java there is an operator called instanceOf,
whats the equivalent in c++?
Introduction to C++.
David Hilsee wrote:"placid" <Bu****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...Hi all,
I was just wondering, in Java there is an operator called instanceOf,
whats the equivalent in c++?
Thanks in advance to all.
The closest equivalent is dynamic_cast (the pointer variant), but it
resembles C#''s "as" more than it does instanceof.
is there another way then a dynamic_cast ?
--
David Hilsee
这篇关于继承与多态性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文