Question : State whether below overload methods will give compilation error or not ?
void SetX(ref int x)
x = 1;
void SetX(out int x)
X = 2;
Gives a compilation error.
SetX method cannot define overloaded methods that differ only on ref and out
Categories: OOPs Interview Questions