Content deleted Content added
m Date/fix the maintenance tags |
|||
Line 10:
The first option is in principle easier, but it is unfortunately limited by the fact that many classes restricts inheritance of certain members or forbids it completely. This includes sealed class and the different primitive data types in C# such as [[Integer (computer science)|int]], [[Floating point|float]] and [[String (computer science)|string]]. The second option, on the other hand, does not share these restrictions, but it may be less intuitive as it requires a reference to a separate class instead of using the methods of the class in question directly.
As an example, lets consider a need of extending the string class with a new reverse method whose return value
string x = "some string value";
string y = Utility.Reverse(x);
|