Why are static classes considered “classes” and “reference types”?

前端 未结 10 1258
生来不讨喜
生来不讨喜 2021-02-01 04:54

I’ve been pondering about the C# and CIL type system today and I’ve started to wonder why static classes are considered classes. There are many ways in which they are not really

10条回答
  •  情深已故
    2021-02-01 05:19

    Good point, it's probably because of historic reasons, i.e. they didn't want to invent something new as static classes already existed.

    C++, Pascal (Delphi) and Java all have static classes, and those are what C# is based on.

提交回复
热议问题