If I have 2 methods of the same name, each taking one parameter. The first takes the parameter by value and the second by reference. When invoking the method how do I specify which version I want to use?
Given
how do I say which version of foo I want to call?
Given
Code:
public class foobar{
...
public foo(int a){}
public foo(ref int a){}
}
how do I say which version of foo I want to call?
Code:
int a = 1;
foobar fb = new foobar();
fb.foo(a); //which foo to call?