由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - another c++ question
相关主题
C++ online Test 一题bloomberg online assessement (JAVA) 4
bloomberg面经Amazon的一些电面问题
[合集] 碰上面试的老印是个白痴,倒霉新鲜Amazon电面经
关于polymorphism和overloading请教template class怎么处理Inheritance问题(面试题)
请问如何准备C/C++面试bloomberg 电面面经
分享面经 mathworks一些面向对象的基本问题
一些oop的概念关于java的position
一个高阶c++问题发个yahoo面经
相关话题的讨论汇总
话题: base话题: function话题: class话题: getbasenum
进入JobHunting版参与讨论
1 (共1页)
b********e
发帖数: 693
1
class Base {
public:
Base();
~Base();
int getBaseNum();
private:
int baseNum;
};
class A : public Base {
public:
A();
~A();
float getBaseNum();
private:
float baseNum;
};
What concept does the sample code above represent?
A. Inheritance
B. Virtual Function
C. Polymorphism
D. Recursion
E. Function overloading
h**k
发帖数: 3368
2
A and E. 按照wiki上的解释,polymorphism也包括function overloading,不过好像
很多人认为polymorphism只限于function overriding.
y*******o
发帖数: 6632
3
my two cents:
this is not function overload at all. The base class function will be
disguised by the child class function. refer to effective c++

【在 h**k 的大作中提到】
: A and E. 按照wiki上的解释,polymorphism也包括function overloading,不过好像
: 很多人认为polymorphism只限于function overriding.

s*****t
发帖数: 737
4
Agree with you, the base class method will got overriden and hiden by the
derived class.

【在 y*******o 的大作中提到】
: my two cents:
: this is not function overload at all. The base class function will be
: disguised by the child class function. refer to effective c++

h**k
发帖数: 3368
5
You are right. The two functions have the same function signatures.

【在 y*******o 的大作中提到】
: my two cents:
: this is not function overload at all. The base class function will be
: disguised by the child class function. refer to effective c++

l***x
发帖数: 21
6

He's right even if the two functions don't have the same signatures.

【在 h**k 的大作中提到】
: You are right. The two functions have the same function signatures.
J******d
发帖数: 506
7
Agreed.
But can this be called polymorphism as well?

【在 y*******o 的大作中提到】
: my two cents:
: this is not function overload at all. The base class function will be
: disguised by the child class function. refer to effective c++

1 (共1页)
进入JobHunting版参与讨论
相关主题
发个yahoo面经请问如何准备C/C++面试
请问大牛们,设计题如何复习?分享面经 mathworks
A家电面一些oop的概念
求教一道ms的题目一个高阶c++问题
C++ online Test 一题bloomberg online assessement (JAVA) 4
bloomberg面经Amazon的一些电面问题
[合集] 碰上面试的老印是个白痴,倒霉新鲜Amazon电面经
关于polymorphism和overloading请教template class怎么处理Inheritance问题(面试题)
相关话题的讨论汇总
话题: base话题: function话题: class话题: getbasenum