WHAT IS CALL BY VALUE AND CALL BY REFERENCE ?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 553  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What is call by value and call by reference ?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!