You are setting the reference to null, you are not changing the object the reference points to.
a and b are two separate references, hence setting a to null will of course leave b unchanged (Think "pointer"), it just means that a now points to null ("nowhere").