difference between call by value and call by reference in java
Answers
Answered by
6
HEY FRIEND!
Here's your answer:
Call by Value: Call by Value is the process of invoking (calling) a function or method by passing a copy of the actual parameters to the formal parameters, such that any change made in the formal parameter will not reflect on the actual parameter.
Primitive type values like int, char, byte, float, double, long, etc. are passed by value.
Call by reference: Call by reference is the process by which the actual reference or location of the actual parameters is passed to the formal parameters such that any change occuring in the formal parameters will reflect on the actual parameters.
Arrays, interfaces, etc. are passed by Call by reference.
#Hope my answer is satisfactory.
#Best of Luck for your ICSE examination (23.03.2018)
Here's your answer:
Call by Value: Call by Value is the process of invoking (calling) a function or method by passing a copy of the actual parameters to the formal parameters, such that any change made in the formal parameter will not reflect on the actual parameter.
Primitive type values like int, char, byte, float, double, long, etc. are passed by value.
Call by reference: Call by reference is the process by which the actual reference or location of the actual parameters is passed to the formal parameters such that any change occuring in the formal parameters will reflect on the actual parameters.
Arrays, interfaces, etc. are passed by Call by reference.
#Hope my answer is satisfactory.
#Best of Luck for your ICSE examination (23.03.2018)
Prasanma:
thanku
Answered by
2
Answer:
Call by Value changes made to formal parameters don't get transmitted back to the caller any modifications to the formal parameters variable inside the called function or method effect only the separate storage location and will not be reflected in the actual parameter in the calling environment.
Call by Reference changes made to formal parameter to get transmitted back to the caller through parameter passing any changes to the formal parameter are reflected in the actual parameter in the calling environment as formal parameter receives a reference to the actual data this method is efficient in both time and space.
mark as brainliest....
Similar questions