class my_a;
int member1 = 1;
endclass
class my_ea extends my_a;
int member1 = 2;
endclass
Now when I do
my_a A;
my_ea EA;
EA =new();
A=EA;
EA = new();
has given handle to object of type my_ea
to class variable EA
.
A=EA;
passes the same handle (pointer value which points to object of my_ea
) to A
. So, A.member1
should refer to value 2.
But it refers to value 1. Why?