Okay, so the reason might be , as you are using value variable of class1, as you can see class2 only extends and sets this value , it doesn't have it's own variable. So, i guess (I am not pretty...
Type: Posts; User: Mr.777
Okay, so the reason might be , as you are using value variable of class1, as you can see class2 only extends and sets this value , it doesn't have it's own variable. So, i guess (I am not pretty...
As far as i know, you misunderstood the concept. Let's make it easy. What do you want to do? You are passing the value of class2 object and you want program to call method accepting class1's object?...
Why does this really amaze you? You are calling it from class C2's object, also you have never referred C1 to C2.
c2.getAnotherValue(aux)
And it's calling
public int visit ( class1 c1) { ...