C# void type- safety

前端 未结 5 1862
眼角桃花
眼角桃花 2021-02-10 04:24

I am just new for C# programming (coming from C++)

My question is: In C# every type inherits from Object Why \'void\' doesn`t?Can it cause some RT/type safety problems

5条回答
  •  遇见更好的自我
    2021-02-10 04:49

    Not everything inherits from Object - That is a common myth. Interfaces don't inherit from Object.

    See this for more details: http://blogs.msdn.com/ericlippert/archive/2009/08/06/not-everything-derives-from-object.aspx

提交回复
热议问题