Class

Question 1
If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access
A
Protected and public data only in C and B
B
Protected and public data only in C
C
Private data in A and B
D
Protected data in A and B
Question 1 Explanation: 
The following table shows the access to members permitted by each modifier.
Question 2
Members of  class by default are
A
Public
B
Private
C
Protected
D
Mandatory to specify
Question 2 Explanation: 
→A class in C++ is a user defined type or data structure declared with keyword class that has data and functions (also called methods) as its members whose access is governed by the three access specifiers private, protected or public (by default access to members of a class is private).
→The private members are not accessible outside the class; they can be accessed only through methods of the class. The public members form an interface to the class and are accessible outside the class.
There are 2 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access