What is it called when trying to overload a function based purely on the return type?
ie:
Public String DoWork()
Public int DoWork()
You cannot do the above, right?
Is that called covariance?
c
What is it called when trying to overload a function based purely on the return type?
ie:
Public String DoWork()
Public int DoWork()
You cannot do the above, right?
Is that called covariance?
Best Answer
It's still called a "method overload" but sometimes you'll hear the more verbose "return-type method overload." It is not possible in C#.
From the C# specification: