What is the difference between static methods in a Non static class and static methods in a static class?

The only difference is that static methods in a nonstatic class cannot be extension methods.


In other words, this is invalid:

class Test
{
    static void getCount(this ICollection<int> collection)
    { return collection.Count; }
}

whereas this is valid:

static class Test
{
    static void getCount(this ICollection<int> collection)
    { return collection.Count; }
}

Leave a Comment