Which method is good "call by value" or call by reference for calling an object?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Which method is good "call by value" or call by reference for calling an object??

8th Apr 2020, 6:26 AM
Bhavya Lohami
Bhavya  Lohami - avatar
2 Answers
+ 2
well it is better to use a call by value by default and only use call by reference  if data changes are expected
8th Apr 2020, 6:59 AM
Thendo
Thendo - avatar
+ 1
it all depends on the situation you are at or to be clear enough depends on the problem you are solving.
8th Apr 2020, 7:27 AM
Rohit