Explain the difference between proc. Sent by val and by sub?



Explain the difference between proc. Sent by val and by sub?..

Answer / 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

More C Sharp Interview Questions

what is ment by Unboxing?

3 Answers  


Define a manifest in .net?

1 Answers  


Is stringbuilder better than string?

1 Answers  


Which is faster list or dictionary in c#?

1 Answers  


Why do we use constructors in c#?

1 Answers  


What do you know about device context?

1 Answers   C DAC,


What is type system in c#?

1 Answers  


What are accessors?

1 Answers  


What are Uses of CLR

1 Answers   TCS,


can you allow a class to be inherited, but prevent the method from being over-ridden?

1 Answers   Siebel Systems,


Why do we use interfaces in c#?

1 Answers  


What is a Assembly?

1 Answers   UGC Corporation,


Categories