Content deleted Content added
→Extension methods and Instance methods: align comments |
|||
Line 44:
==Extension methods and Instance methods==
In C# 3.0, both an instance method as well as an extension method with the same signature can exist for a class. In such a scenario, the instance method is preferred over the extension method. Neither the compiler nor the [[Microsoft Visual Studio]] IDE warns about the naming conflict. Consider this C# class, the <code>GetAlphabet()</code> method is invoked on an instance of this class:
<source lang="csharp">
Line 64:
</source>
Result with the instance method has not been implemented but the extension method has been:
ABC
Result with the both the instance method and extension method implemented:
abc
|