Computer Science, asked by Anonymous, 9 months ago

■Differentiate between call by value or pass by value and call by reference or pass by reference.■

Answers

Answered by duragpalsingh
0

Hello dear!

Call by Value:

• The actual parameter is copied to the formal parameter in such a way that any change made in the formal parameter does not affect the actual parameter. The actual parameter remains intact.

• All primitive type data are passed to the method using pass by value. For eg: int, float, double, long , char etc.

Call By Reference:

• The actual parameter is referred by the formal parameter(both use same memory address) in such a way that any change made in the formal parameter is reflected onto the actual parameter. Hence, the actual parameter also changes accordingly.

• All non-primitive type data are passed to the method by using pass by reference system. For eg: array, object, etc.

Answered by aryankunalroy38
0

Answer:

Call by value method copies the value of an argument into the formal parameter of that function. Call by reference method copies the address of an argument into the formal parameter. In call by value method, a copy of the variable is passed whereas, In call by reference method, a variable itself is passed.

mark me as brainliest answer ☺️ ☺️

Similar questions