首页 > 其他分享 >.NET中的Object类

.NET中的Object类

时间:2022-11-12 19:35:12浏览次数:30  
标签:hierarchy Object classes 基类 NET 方法

  • 代码中的解释:

// Supports all classes in the .NET class hierarchy and provides low-level services
// to derived classes. This is the ultimate base class of all .NET classes; it is
// the root of the type hierarchy.
可以看出,Object类是所有类的基类,而值类型和引用类型的存储方式不同,C#允许值类型的值和引用类型之间转换,称之为拆箱和装箱。

  • Object类中的方法

image
值得注意的一个是ToString方法,基类中存在此方法,故所有的类中都有此方法,可能会重写此方法,此方法经常被调用。

标签:hierarchy,Object,classes,基类,NET,方法
From: https://www.cnblogs.com/HamburgerX/p/16884469.html

相关文章