Overloaded methods with identical signatures cause compilation errors, even if return types are different. : Overloading Method « Class Interface « C# / C Sharp






Overloaded methods with identical signatures cause compilation errors, even if return types are different.




public class MethodOverloadError
{
   public int Square( int x )
   {
      return x * x;
   }
   public double Square( int y )
   {
      return y * y;
   }
}



       








Related examples in the same category

1.Operator Overloading
2.Illustrates method overloadingIllustrates method overloading