Strings are immutable, you can't change string's content, like you can do with a StringBuffer or StringBuilder. But you can change the value of reference, so when you used "r1.setName("Bird");", you were changing the reference of the attribute name.
Cheers.