title: How to swap two string variables in Java without using a third variable
body: <p>How do I swap two string variables in Java without using a third variable, i.e. the temp variable?</p>
  
  <pre><code>String a = "one"
  String b = "two"
  String temp = null;
  temp = a;
  a = b;
  b = temp;
  </code></pre>
  
  <p>But here there is a third variable. We need to eliminate the use of the third variable.</p>