Sunday, May 18, 2008

Is overloading method by return type permitted in C#?

No, overloading methods by return type is not permitted in C#

void Method();
void Method(int a); //ok: different parameter set
void Method(string a, int b);//ok again
void Method(string h, int t);//error same parameter set as previous method
int Method(int g); //error: can't overload based on return type only

No comments: