C # essence on reading notes

Source: Internet
Author: User

1. Constant Const FEATURE:

Constants must be initialized at declaration time, and when a value is specified, it is no longer possible to modify the

Constants are always static and do not have to (in fact, be disallowed) include modifiers in a constant declaration static

Constants cannot be initialized from values that are extracted from a variable, and if you need to do so, you should use a read-only field???

2. Reference type and value type

Difference: value types store their values directly, whereas reference types store addresses that reference values, value types are stored on the stack, and reference types are stored on the managed heap

3, all integer types of variables can be given a decimal or hexadecimal value, the latter requires a 0x prefix long x =0x12ab;

To specify the type of value as a different integer type, you can add the following character after the number: uint num = 1234U;  Long num =1234l; ULONG Num =1234ul;

In fact, there is no need to add, because at compile time will be added automatically, such as: long num = 8; Num =num+12; Anti-compilation In the past, is a long num =8l; num = num+12l;

Cond...

Passing essays Beijing 20160128

C # essence on reading notes

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.