C# Programming - Polymorphism - Discussion

Discussion Forum : Polymorphism - General Questions (Q.No. 6)
6.
Which of the following is the correct way to overload + operator?
public sample operator + ( sample a, sample b )
public abstract operator + ( sample a, sample b)
public abstract sample operator + (sample a, sample b )
public static sample operator + ( sample a, sample b )
All of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
7 comments Page 1 of 1.

Amey Deshpande said:   1 decade ago
Overloaded methods should be static.

Sami said:   1 decade ago
Why there is no return type?

Ngtdung said:   1 decade ago
The return type is "sample".

Vlad said:   1 decade ago
Do you mean overloaded operator should be static?

Firoza said:   10 years ago
Why static only?

Vaseem said:   10 years ago
It may have return type or not.

Prasad said:   8 years ago
Option 1 is also correct for non-static class.

Post your comments here:

Your comments will be displayed after verification.