What happens if the base and derived class contains definition of a function with same prototype mcq?
Answers
Answered by
1
Hey there!
--------
Q. What happens if the base and derived class contains definition of a function with same prototype?
Options -:
[a]. Compiler reports an error on compilation.
[b]. Only base class function will get called irrespective of object.
[c]. Only derived class function will get called irrespective of object.
[d]. Base class object will call base class function and derived class object will call derived class function. ✔
• Answer => Option [d]. Base class object will call base class function and derived class object will call derived class function.
--------
Q. What happens if the base and derived class contains definition of a function with same prototype?
Options -:
[a]. Compiler reports an error on compilation.
[b]. Only base class function will get called irrespective of object.
[c]. Only derived class function will get called irrespective of object.
[d]. Base class object will call base class function and derived class object will call derived class function. ✔
• Answer => Option [d]. Base class object will call base class function and derived class object will call derived class function.
Answered by
0
Answer:
if the base and derived class contains definition of a function with same prototype then a Compiler reports an error on compilation.
#SPJ3
Similar questions
Science,
7 months ago
Science,
7 months ago
Social Sciences,
1 year ago
Math,
1 year ago
Science,
1 year ago