How to access the private variables of a class in its subclass?
- by giri
This is a question I was asked in an interview: I have class A with private members and Class B extends A. I know private members of a class cannot be accessed, but the question is: I need to access private members of class A from class B, rather than create variables with the same value in class B.
I hope I am clear with this question.
Thanks.