Java Pass by value
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/498747/java-pass-by-value-reference-variables">Java, pass-by-value, reference variables</a>  </p>
</blockquote>



<p>Consider the following simple java program</p>

<pre><code>class main{
          public static void main(String args[]){
                int x = 5;
                change(x);
                System.out.println(x);
          }
          static void change(int x){
             x = 4;
          }
 }
</code></pre>

<p>Since java uses pass by value the value of x will not change in the main..To overcome this problem we have the concept of pass by reference in c..But i do not find any such concept in java..How can i really change the value of x..? If there is no way of changing x then is this not a disadvantage of java?</p>
