Redundant to inherit from Object in C#?

后端 未结 7 835
后悔当初
后悔当初 2021-01-07 16:32

As stated above, is it redundant to inherit from Object in c#? Do both sets of code below result in equivalent objects being defined?

class TestClassUno : Ob         


        
7条回答
  •  太阳男子
    2021-01-07 17:20

    Yes, they are both the same thing, I don't think I saw anyone mention structs, but all objects (that is regardless if you declare a class or a struct) they all ultimately inherit from Object, see this Object MSDN article and this other article on Structs

提交回复
热议问题