Object Oriented Programming

1:

Class A

{

int  i1;

protected :

int  i2;

public :

int i3;

}

class B : public A

{

public :

int i4;

};

class C :B

{

};

Which varilible(s) is/are accessible from the main function?     

A.

i1

B.

i 2

C.

i 3

D.

None of the above

 

Answer : D

Explanation :

reetikaa said: (10:03pm on Thursday 24th September 2015)
i think it shuld be i3 as it is accessible to all since it is public
Muhammad Ali said: (12:34am on Wednesday 28th February 2018)
i3 will be accessible from the main function as it is public

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.