adspace
Explain the difference between proc. Sent by val and by sub?
Answer Posted / Naresh Pal Singh
In C#, procedures can be sent to methods using two ways: 'by value' and 'by reference (or ref)'.n'By Value': When a procedure is called with the value type arguments, it gets copied into the method call stack. Any change made inside the method does not affect the original variable outside the method. This behavior is known as passing by value.n'By Reference': When a procedure is called with the reference type arguments (like object, class), it doesn't get copied to the method call stack; instead, the memory address of the variable is passed to the method. Any change made inside the method affects the original variable outside the method. This behavior is known as passing by reference.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers