English

Differentiate between call by value and call by reference. - Computer Applications

Advertisements
Advertisements

Question

Differentiate between call by value and call by reference. 

Distinguish Between

Solution

S. No. Call by value Call by reference
1. Pass-by value transfers a copy of the actual parameters to the formal parameters. Pass by reference refers to conveying the address of actual parameters to formal parameters.
2. Changes in formal parameters do not affect actual parameters. Changes to formal parameters will be mirrored in actual parameters.
3. Call by value is typically used for primitive data types (e.g., int, char). Use call-by-reference for non-primitive data types, such as objects and arrays.
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: User - Defined Methods - EXERCISES [Page 337]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 5 User - Defined Methods
EXERCISES | Q VI. 11. | Page 337
Avichal Computer Applications [English] Class 10 ICSE
Chapter 5 User - Defined Methods
Review Insight | Q 9. | Page 333
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×