Test - Call by reference and call by value in java

output is :-

The dog name is ss
The dog name is aa
The dog name is pp
The dog name is xx
The dog name is aa