title: How can I pass a variable by value in Java?
body: <p>I'm new too Java, but I'm very experienced with PHP. When I was writing a Java program, I noticed that the variables aren't what I'm expecting.</p>
  
  <blockquote>
    <p>All method parameters are passed by value in Java. However, since all
    Objects are actually references, you're passing the value of the
    reference when you pass an object. This means if you manipulate an
    object passed into a method, the manipulations will stick.</p>
  </blockquote>
  
  <p>From here: <a href="https://stackoverflow.com/questions/411254/what-are-the-differences-between-php-and-java">What are the differences between PHP and Java?</a></p>
  
  <p>What does this mean? Does it mean that <code>foo=blah</code> in Java is like <code>$foo=&amp;$blah</code> in PHP?
  How can I pass just the value in Java?</p>