void Swap(Empolyee lhs, Empolyee rhs) {
Empolyee tmp = lhs;
lhs = rhs;
rhs = tmp;
}
I want to swap two Employees using this method, but it doesn’t work. Although it works after imposing ref keyword on the parameter, I want to know the reason why the former doesn’t work. Because every object in C# is reference-type, I thought it should work. I am looking forward to your help, thanks.
Then call: