Home > DeveloperSection > Interviews > What is call by value and call by reference ?

Posted on    July-14-2015 11:34 PM

 Java Java 
Ratings:
 1 Answer(s)
  366  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-14-2015 11:34 PM

Call by Value - When a method receives a value as an argument, the value received is a copy of the original value of the calling method. Even if the value is altered inside the method, it won't be reflected in the variable in the calling method.
Call by reference - When a method receives reference of a variable, any change made to it in the called method won't be reflected in the calling method.

Don't want to miss updates? Please click the below button!

Follow MindStick