Code inspection: Class cannot be instantiated
This inspection reports a class that cannot be instantiated. This commonly means a class with only a private constructor and no instance creation path. Such a class is often intended to be a static utility type, or it is missing constructors that callers need.
Example
public sealed class StringUtil
{
private StringUtil() { }
public static string CustomSplit(string s, char c)
{
return s;
}
}
public static class StringUtil
{
public static string CustomSplit(string s, char c)
{
return s;
}
}
Quick-fix
This inspection offers fixes such as converting the class to a static class or generating constructors when that is the intended design.
30 March 2026