Ranchers,
Below is the code snippet.
When I ran this program, I got the output 1 1 1. But I was expecting 2 2 2 as the actual object that we pass to the printAll method is B.
When we invoke the method printAll, the parameter obj of the printAll method will have the bit
pattern to get to the actual object, that is B.
So when we try to print obj.i, shouldn't it be class B's i value..?
Can someone please help me understand this..?