When to use static classes and methods?

前端 未结 4 881
离开以前
离开以前 2021-01-12 13:10

I have a general question...when should i be using static classes or static methods?.. I know the idea that static methods can be called without instantiating...and static c

4条回答
  •  温柔的废话
    2021-01-12 13:47

    I think the following two links offer a clear answer for what you're looking for. Take a look at them:

    For static classes:

    When to Use Static Classes in C#

    For static methods:

    When is it appropriate to use static methods? ( Jon Skeet [the Guru] answered this one :o) )

提交回复
热议问题