Can same argument method with ref and out be overloaded in C#?

(Last Updated On: February 25, 2019)

Answer: No, methods with ref and out parameters in C# with same number of arguments can’t be overloaded.

For example, in below class we’ll get compiler error if we try to overload one methods having ref parameter and another having out parameter.

However,it can be overloaded if we have method with ref or out parameter with another method without ref or out parameter in C#.