KEY DIFFERENCE
- In the Call by value method original value is not modified whereas, in the Call by reference method, the original value is modified.
- In Call by value, a copy of the variable is passed whereas in Call by reference, a variable itself is passed.
- In Call by value, actual and formal arguments will be created in different memory locations whereas in Call by reference, actual and formal arguments will be created in the same memory location.
- Call by value is the default method in programming languages like C++, PHP, Visual Basic NET, and C# whereas Call by reference is supported only Java language.
- Call by Value, variables are passed using a straightforward method whereas Call by Reference, pointers are required to store the address of variables.
No comments:
Post a Comment