CLR via C# 3rd - 04 - Type Fundamentals】的更多相关文章

1. System.Object        The runtime requires every type to ultimately be derived from the System.Object type.        Because all types are ultimately derived from System.Object, you are guaranteed that every object of every type has a minimum set of…
1. Different Kinds  of Type Members        A type can define zero or more of the following kinds of members:        Constants           A constant is a symbol that identifies a never-changing data value        Fields           A field represents a re…
1. Primitive Types        Any data types the compiler directly supports are called primitive types.        Primitive types map directly to types existing in the Framework Class Library (FCL).        For the types that are compliant with the Common La…
1.All Types Are Derived from System.Object The CLR requires all objects to be created using the new operator(Employee e = new Employee("ConstructorParam1");) the new operator does: 1.It calculates the number of bytes required 2.It allocates memo…
   Kinds of methods        Constructors      Type constructors      Overload operators      Type conversions (for implicit and explicit casting)      Extension methods      Partial methods.              1. Instance Constructors and Classes (Reference…
1. Constants        A constant is a symbol that has a never-changing value. When defining a constant symbol, its value must be determinable at compile time. The compiler then saves the constant’s value in the assembly’s metadata. This means that you…
1. Weakly Named Assembly vs Strong Named Assembly        Weakly named assemblies and strongly named assemblies are structurally identical—that is, they use the same portable executable (PE) file format, PE32(+) header, CLR header, metadata, manifest…
1. C# Compiler - CSC.exe            csc.exe /out:Program.exe /t:exe /r:MSCorLib.dll Program.cs      This command line tells the C# compiler to emit an executable file called Program.exe (/out:Program.exe). The type of file produced is a Win32 console…
1. Assemly       A managed module is a standard 32-bit Microsoft Windoes portable executable (PE32) file or a standard 64-bit Windows portable executable (PE32+) file that requires the CLR to execute.        Managed Module = IL + metadata.        Ass…
一.等值性——Equals()方法 有时候我们需要比较两个对象是否相等,比如在一个ArrayList中进行排序查找等操作时. System.Object提供了Equals()虚方法: class Object { public virtual Boolean Equals(object o) { if (this == o) return true; else return false; } } 这种判断方式非常简单:直接比较是两个引用是否指向的是同一对象.但这样比较是不确切的.所以我们需要重写…