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
Simple!!!
public class A{ private String a; private String b; //getter and setter are here }
public class B extends A{ public B(String a, String b){ //constructor super(a,b)//from here you got access with private variable of class A } }
thanks