I am not quiet sure about the concept of \"passing by value\" and \"passing by reference\" in c#. I think Passing by value mean :
int i = 9;
Few Points:
In C# unless, you use ref keyword, it is always Pass By Value.
Pass By Value: In case of Value Type - It is just another copy of Value Type Variable.
In case of Reference Type - It is a copy of reference (or pointer) to exact location where memory is assigned in heap.
Pass By Reference:
for Reference type variable - passing it to another method by using keyword is only useful in the scenario when the passed variable can be reassigned in the called method. It means :
let's say - Outside (caller) method A inside (called) method B
Reference Type Object R -passed to method B from method A then if you reassign the memory location of Object R in method B then those changes wouldn't be seen in Method A of Object R unless you pass the object R using ref keyword (i.e pass by reference).