ProAnswers.org

What is the difference between the pass By Value and pass By Reference in java?

Primitive variables are passed by value.
reference variables are passed by reference.
When you pass a primitive variable, the JVM will copy the value of the passed-in variable to a new local variable.
If you change the value of the local variable, the change will not affect the passed in primitive variable.
If you pass a reference variable, the local variable will refer to the same object as the passed in reference variable.
If you change the object referenced within your method, the change will also be reflected in the calling code