Computer Science, asked by yashrrtttt3443, 1 year ago

What happens if the base and derived class contains definition of a function with same prototype mcq?

Answers

Answered by Anonymous
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.
Answered by ShraddhaKhanna
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