Utility classes, which are collections of https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/static[`static`] members, are not meant to be instantiated.
C# adds an implicit https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/public[`public`] https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/constructors[`constructor`] to every class which does not explicitly define at least one constructor. Hence, at least one https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/protected[`protected`] constructor should be defined if you wish to inherit this utility class. Or the `static` keyword should be added to the class declaration to prevent inheriting it.
very minor edits [~tamas.vajk]. Assigned to you for double-check
=== on 25 Jun 2015, 06:23:47 Tamas Vajk wrote:
\[~ann.campbell.2] thanks, it looks good.
=== on 25 Jun 2015, 17:39:51 Ann Campbell wrote:
\[~tamas.vajk] I noticed you overrode the SQALE remediation cost. Is this truly a language-specific difference, or do you think it's wrong in the main task?
=== on 26 Jun 2015, 06:24:39 Tamas Vajk wrote:
\[~ann.campbell.2] In Java you can write call a utility method through an instance, like ``++(new StringUtils()).Concatenate("a", "b")++``, so if you change the visibility of the constructor, then you'll need to change all these calls to ``++StringUtils.Concatenate(...)++``. However, in C# you can't use a static method through an instance, so changing the visibility of the constructor won't affect the code as much as in Java.
But thinking about it a bit, the 2 minutes is a bit too short, I'll modify it to 10mn, because you might have useless ``++new StringUtils()++`` calls in the code.