The formal parameter in a method becomes an alias of the actual parameter sent to the method. So when the method begins executing, the parameter string refers to the String object "String". However, when you assign the formal parameter to point to another object, it has no effect on the original object or actual parameter.
If you are thinking that you are passing an oblject of String class, any change in the method should reflect to the original one. But here you are forgetting one very important thing and that is, String instances are "immutable".
so when you will say,
internally, it wiil create new String object like this,
And as java doesn't support pass/call by referance... now it is refering to another object in the heap.
On your way in you may have missed that we have a JavaRanch Naming Policy for displayed (screen) names. Your displayed name must consist of a first name (or an initial), a space, and a family name (in that order) and not be obviously fictitious. Since yours "Mona M", does not conform with it, please take a moment to change it, which you can do right here.
Posters with nonconforming displayed names will be locked out of JavaRanch after a few posts using those names.