how do I make my swap function in java?
<p>how do I make my swap function in java if there is no method by which we can pass by reference?  Could somebody give me a code?</p>

<pre><code>swap(int a, int b)
{
     int temp = a;
     a = b;
     b = temp;
}
</code></pre>

<p>but the change wont be reflected back since java passes by value</p>
