Computer Applications
Differentiate between CALL by reference and CALL by value.
User Defined Methods
13 Likes
Answer
Call by value | Call by reference |
---|---|
Actual parameters are copied to formal parameters. | Formal parameters refer to actual parameters. |
Any changes to formal parameters are not reflected onto the actual parameters. | The changes to formal parameters are reflected onto the actual parameters. |
All primitive data types are passed using Call by value. | All reference data types like arrays and objects of classes are passed using Call by reference. |
It is used to keep original data secure and unchanged. | It is used when the original data values need to be modified. |
Answered By
7 Likes
Related Questions
Give the prototype of a function check which receives a character ch and an integer n and returns true or false.
Write a function that takes an int argument and doubles it. The function does not return a value.
What is polymorphism? How does function overloading implement polymorphism?
What is function overloading ?