However this will not work as by default java does pass by value.
Java does a pass by value for primitive data types and by reference for objects. So, inside a method if you make any alterations to the argument that is an object, this will be reflected after the method call. However, since string is an immutable object, so you can not change it in any way.
Answering your question, you can not swap the values of two string references using a separate method.