OOPS
August 29, 2024OOPS
August 29, 2024OOPS
|
Question 97
|
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
|
only protected and public data of C and B
|
|
|
Only protected and public data of C
|
|
|
all data of C and private data of A and B
|
|
|
public and protected data of A and B and all data of C
|
Question 97 Explanation:
→ It is nothing but multilevel inheritance.
→ 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 public and protected data of A and B and all data of C
→ 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 public and protected data of A and B and all data of C
Correct Answer: D
Question 97 Explanation:
→ It is nothing but multilevel inheritance.
→ 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 public and protected data of A and B and all data of C
→ 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 public and protected data of A and B and all data of C
