- System.Object 类型提供了以下方法,
-
Syste.Object
1 namespace System 2 { 3 // 4 // 摘要: 5 // 支持 .NET Framework 类层次结构中的所有类,并为派生类提供低级别服务。这是 .NET Framework 中所有类的最终基类;它是类型层次结构的根。 6 [ClassInterface(ClassInterfaceType.AutoDual)] 7 [ComVisible(true)] 8 public class Object 9 { 10 // 11 // 摘要: 12 // 初始化 System.Object 类的新实例。 13 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] 14 public Object(); 15 16 // 17 // 摘要: 18 // 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 19 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] 20 ~Object(); 21 22 // 23 // 摘要: 24 // 确定指定的对象实例是否被视为相等。 25 // 26 // 参数: 27 // objA: 28 // 要比较的第一个对象。 29 // 30 // objB: 31 // 要比较的第二个对象。 32 // 33 // 返回结果: 34 // 如果认为对象相等,则为 true;否则为 false。如果 objA 和 objB 都为 null,则方法返回 true。 35 [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] 36 public static bool Equals(Object objA, Object objB); 37 // 38 // 摘要: 39 // 确定指定的 System.Object 实例是否是相同的实例。 40 // 41 // 参数: 42 // objA: 43 // 要比较的第一个对象。 44 // 45 // objB: 46 // 要比较的第二个对象。 47 // 48 // 返回结果: 49 // 如果 objA 是与 objB 相同的实例,或如果两者均为 null,则为 true;否则,为 false。 50 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] 51 [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] 52 public static bool ReferenceEquals(Object objA, Object objB); 53 // 54 // 摘要: 55 // 确定指定的对象是否等于当前对象。 56 // 57 // 参数: 58 // obj: 59 // 要与当前对象进行比较的对象。 60 // 61 // 返回结果: 62 // 如果指定的对象等于当前对象,则为 true;否则为 false。 63 [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] 64 public virtual bool Equals(Object obj); 65 // 66 // 摘要: 67 // 作为默认哈希函数。 68 // 69 // 返回结果: 70 // 当前对象的哈希代码。 71 [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] 72 public virtual int GetHashCode(); 73 // 74 // 摘要: 75 // 获取当前实例的 System.Type。 76 // 77 // 返回结果: 78 // 当前实例的准确运行时类型。 79 [SecuritySafeCritical] 80 public Type GetType(); 81 // 82 // 摘要: 83 // 返回表示当前对象的字符串。 84 // 85 // 返回结果: 86 // 表示当前对象的字符串。 87 public virtual string ToString(); 88 // 89 // 摘要: 90 // 创建当前 System.Object 的浅表副本。 91 // 92 // 返回结果: 93 // 当前 System.Object 的浅表副本。 94 [SecuritySafeCritical] 95 protected Object MemberwiseClone(); 96 } 97 }
相关文章: