Function overloading is done at compile time. TRUE
Protected members are accessible to the member of derived class. TRUE
EXPLANATION: We can summarize the different access types according to - who can access them in the following way −
Access |
public |
protected |
private |
Same class |
yes |
yes |
yes |
Derived classes |
yes |
yes |
no |
Outside classes |
yes |
no |
no |
A derived class inherits constructors and destructors. FALSE
EXPLANATION: A derived class inherits all base class methods with the following exceptions −
- Constructors, destructors and copy constructors of the base class.
- Overloaded operators of the base class.
- The friend functions of the base class.
Following are the things which a derived class inherits from its parent.
1) Every data member defined in the parent class (although such members may not always be
accessible in the derived class!)
2) Every ordinary member function of the parent class (although such members may not always be
accessible in the derived class!)
3) The same initial data layout as the base class.
A friend function can be called like a normal function. TRUE
EXPLANATION: The function that declared with keyword friend is said to be friend function.It can be invoked like a normal function without using any objects. a friend function, that is a "friend" of a given class, is a function that is given the same access as methods to private and protected data.
Nested class is a derived class. FALSE
ANS: D