title: How to write a basic swap function in Java
body: <p>I am new to java. How to write the java equivalent of the following C code.</p>
  
  <pre><code>void Swap(int *p, int *q)
  {
     int temp;
     temp = *p;
     *p = *q;
     *q = temp;
  } 
  </code></pre>