Yes it does so. Actually after the last line ref
will point to whatever a points to.
Whatever you do to the reference is also done to the original object.
So all you do is defining an alternative name for the same variable.
There are few things you need to remember
i) references are different from pointers
ii) pointer may be undefined /null but reference should always be associated with a variable.
iii) pointer may be able to point to different variable at different time; reference always associated with the same variable throughout it's life.
Check this question