I just noticed that overriding methods does behave different than overriding fields.
Considering the following snippet:
public class Bar {
int v =1;
When you are calling foo.printAll(); It is calling the function of the base class which is printing the value 1. Then you are calling printV.This time since the inherited class has a function of the same name, it is overridden and printV of Foo is called.
The value of v depends on from which class you are printing the value.