I have the following code :
class Calculator
{
public int Sum(int x, int y)
{
return x + y;
}
public int Sum(o
out parameter modifier (C# Reference)
Although the ref and out keywords cause different run-time behavior, they are not considered part of the method signature at compile time. Therefore, methods cannot be overloaded if the only difference is that one method takes a ref argument and the other takes an out argument.
Also see: ref (C# Reference)
Members of a class can't have signatures that differ only by ref and out. A compiler error occurs if the only difference between two members of a type is that one of them has a ref parameter and the other has an out parameter.