

MCQOPTIONS
Saved Bookmarks
1. |
Which among the following is true for the code given below:a) Only object of class A can access disp() function class A { int marks; public : disp() { cout<<marks; } } class B: protected A { char name[20]; } A a; a.disp(); B b; b.disp(); |
A. | Only object of class A can access disp() function |
B. | Only object of class B can access disp() function |
C. | Both instances can access disp() function |
D. | Accessing disp() outside class is not possible |
Answer» B. Only object of class B can access disp() function | |