04. C # type system, value type, and reference type (Chapter 2 2.2-2.3 ),

Source: Internet
Author: User

04. C # type system, value type, and reference type (Chapter 2 2.2-2.3 ),

All the things to be written today are conceptual things in the book. Just take notes and write them in the form of questions and conversations. Maybe there will be something to talk about during interviews in the future ~~~

Q1.C #1 What are the three features of the system type?

A1.C #1 is static, explicit, and secure.

 

Q2. why is it a static type?

A2static type is used to describe the type of the expression during compilation. When declaring a type variable, the variable cannot point to other types of objects.

 

Q3. What are the differences between explicit and implicit types?

A3. explicit and implicit types are valid only for languages in static types. Explicit type requires explicit declaration of the type of a variable, while implicit type pushes the responsibility for determining the type to the compiler. However, during compilation, the type of the variable is known.

  

Q4. which of the following types are the value type and reference type respectively?

A4. the class is the reference type, the structure is the value type, the array type is the reference type, the enumeration is the value type, the delegate is the reference type, and the interface is the reference type.

  

Q5. judge whether the following statements are true or false.

1. The structure is a lightweight class.

2. The reference type is stored on the stack, and the value type is stored on the stack.

3. Objects in C # are passed by reference by default.

A5. the above three statements are all incorrect.

  

In Q6.C #4, if dynamic types are to be used, what keywords are used?

A6.dynamic, such as dynamic o = "kkk", the responsibility for this type of judgment is pushed to the runtime.

Please make an axe.

  

Reference page:

Http://www.yuanjiaocheng.net/CSharp/Csharp-arraylist.html

Http://www.yuanjiaocheng.net/CSharp/Csharp-sortedlist.html

Http://www.yuanjiaocheng.net/CSharp/Csharp-stack.html

Http://www.yuanjiaocheng.net/CSharp/Csharp-queue.html

Http://www.yuanjiaocheng.net/CSharp/Csharp-hashtable.html

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.