505 views

Match the following concepts and their best possible descriptions.

Concept   Description
i. overloading a. allows to define a class to have properties of another class
ii. friend b. defining a set of similar functions
iii. constructor c. used in dereferencing
iv. protected d. used to give a non-member function access to the private parts of an object
v. this e. a function which is automatically called when an object is created
vi. inheritance f. allows a derived class to have access to the private parts of the base class
g. a pointer to the object associated with the current function
h. used to obtain object persistence
1. i-b, ii-d, iii-e, iv-f, v-g, vi-a
2. i-c, ii-a, iii-e, iv-d, v-h, vi-f
3. i-c, ii-f, iii-h, iv-a, v-g, vi-d
4. i-b, ii-e, iii-c, iv-f, v-g, vi-s

edited | 505 views

(A) is the answer. All are straight from definitions.
by Veteran (431k points)
selected
+1 vote

ii.Friends are functions or classes declared with the friend keyword.
A non-member function can access the private and protected members of a class if it is declared a friend of that class. That is done by including a declaration of this external function within the class, and preceding it with the keyword friend : (d)

v. ‘this’ is a reference variable that refers to the current object. : (g)

Suitable option : (A)

by Active (2.5k points)