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
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

0 comments:
Post a Comment