according to the following code:
public class Ex1{
protected int a;
private int b;
public Ex1(int a, int b){
this.a=a;
this.b=b;
}
}
public class Ex2 extends Ex1{
public Ex2(){
super(4,2); //ejemplo
}
}
public class Tester{
public static void main (String [] args){
Ex1 test= new Ex2();
}
}
At the time of creation of the object referenced by the variable test. What happens to the private instance attribute "b" of class Ex1? I understand that the object will be created of type Ex2, and within its internal state will be its private attributes (if any) and those it inherits. But I'm not sure where the value of "b" would be saved. I did it in the compiler a while ago, and it does save, because if I create a getB method in Ex1, I can get its value.