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 qu
I don't know about Java, but in some languages nested types can do this:
class A { private string someField; class B : A { void Foo() { someField = "abc"; } } }
Otherwise, use an accessor method or a protected field (although they are often abused).
protected