well lets start from line 12. AS there is a new object of Foo is created the value of barNum for that object is '0' .
then we have which passes the bar object as a reference.
In line 5 it prints the value of 99 as the value of barNum is changed to 99.
In line 6 a new object of Bar is created and thus the reference to the previous bar is lost for that variable, which now points to a new object.
In line 8 420 is printed since that is the value for the new bar object.
Now when we return to line 14 the value for barNum is going to be 99 since that is the last time the value has been changed for that object.
The object passed as an argument is shadowed by the creation of a new object in the method.