retagged by
13,554 views
0 votes
0 votes
Which of the statements are true ?
I. Function overloading is done at compile time.
II. Protected members are accessible to the member of derived class.
III. A derived class inherits constructors and destructors.
IV. A friend function can be called like a normal function.
V. Nested class is a derived class.

(A) I, II, III

(B) II, III, V

(C) III, IV, V

(D) I, II, IV
retagged by

1 Answer

Best answer
0 votes
0 votes

 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

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
2 answers
2
rishu_darkshadow asked Sep 16, 2017
3,497 views
A __________ is a special method used to initialize the instance variable of a class.(A) Member function(B) Destructor(C) Constructor(D) Structure
0 votes
0 votes
1 answer
4
rishu_darkshadow asked Sep 17, 2017
1,429 views
The unlicensed National Information Infrastructure band operates at the _________ frequency(A) 2.4 GHz(B) 5 GHz(C) 33 MHz(D) 5 MHz