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


Please Help Members By Posting Answers For Below Questions

Which namespaces are necessary to create a localized application?

1151


What is expression tree in c#?

1007


How to assign Null value to Var?

1073


Why can't we use a static class instead of singleton?

963


What is an abstract class c#?

978


How do you inherit a class into other class in c#?

1001