title: Java Swapping not done for int values
body: <p>I a, getting the output as 10 9 9 10 for this program but I am not able to understand why swapping is not working.</p>
  
  <p>Given below is the code: </p>
  
  <p>public class Swap {</p>
  
  <pre><code>public static void main(String[] args) {
      int a=9;
      int b=10;
  
      swap(a, b);
  
      System.out.println(a);
      System.out.println(b);
  }
  
  public static void swap(int a ,int b){
  
      int temp=0;
      temp=a;
      a=b;
      b=temp;
      System.out.println(a);
      System.out.println(b);
  
  
  }
  </code></pre>