Chapter 4
All types in 1. C # Are objects and are based on the. NET system. Object Class. All variables have a set of basic functions and behavioral characteristics.
2. Use Pascal's case sensitivity specification when defining a method and camel's case sensitivity specification when defining a variable name.
3. The interface name is usually prefixed with "I" in upper case.
4. The biggest drawback of treating everything as an object is that it reduces performance.
5. The primary rule for value types is that they cannot be empty and their types are enumeration and structure.
6. The reference types are similar to those of C ++. They are all type-safe pointers. Allocating a reference type is actually allocating a value on the stack and returning a reference pointing to this value.
7. Packing is to convert the value type to the reference type, and unpacking is the opposite. The packing process requires no display conversion, while the unpacking process requires a display conversion.
8. All types of root classes are system. object. It can be said that all types are derived from this root class.
9. Methods of the system. Object Type: bool equals (), int gethashcode (), type GetType (), string tostring ()
10. Protected Methods: void finalize () and object memberwiseclone
Alternative: A derived class can replace the base class and display the conversion when the base class is replaced.
CTS itself is defined in the CLS of the public language specification, and CLS is for each. The net compiler defines a separate set of rules to ensure that the code output by each compiler is consistent with that output by CLR.
11. The benefits of CTs are mainly in three aspects: language interoperability, single object hierarchy, and type security.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service