[. NET object-oriented programming fundamentals] (3) The basis of the basis-data type

Source: Internet
Author: User

[. NET Object-oriented Programming fundamentals ] (3) Base of the foundation-data type

About data types, which is the basis of the foundation.

Basis.. Basis.. Basis. Basic skills must be solid.

First of all, starting from the use of computers, and then programming, the computer to store data, it will be stored by type, as we bought clothes, pants, tops, winter, summer, always divided into a class and put in the wardrobe. The more advanced the programming language, the more detailed the data type points.

The question comes, so many data types, we are not to remember, this is really not a worry about things, do not fear, do not fear, do not fear, important things to say three times.

Key points: C # just the type of data.

Exactly, there are 15 predefined types, other types are defined by this underlying type ( for example: Enum type is a composite value type, and for example: class type, interface type, array type, delegate type attribute application type , they are derived from, and said more, we first ignore, The latter will be a little clearer). As long as we remember these 15 kinds, the latter thing is much better.

Focus: Speaking of classifications, this the types are divided into two categories, one of which is a value type (with - One ), one is a reference type Yes (yes 2 A: string and the Object )

Below into the learning English stage, open a joke, remember these 15 types, just like learning English words. Start remembering it.

Come to me: integer 8, float 1, decimal 1, boolean 1, char character type 1, reference type (string string type one, object type 1)

( 8+1+1+1 ) + ( up ) =15

OK, just 15 of them, we're all done. Here's a list of specific tables

About escape characters

In order to use some special character types, C # uses escape characters

The following escape characters are in the character type:
1,\ ' is used to denote single quotes
2,\ "is used to denote double quotation marks
3,\\ is used to indicate a backslash
4,% = null character
5, \a used to denote exclamation marks
6, \b used to indicate backspace
7, \f used to represent a page change
8, \ n is used to indicate line break
9, \ r is used to indicate carriage return
\ t is used to indicate horizontal tab
\v is used to denote vertical tab

Points:

    1. Data types are divided into value types (Valuetype) and reference types (referencetype)
    2. Value types store the actual values, whereas reference types are references to values stored somewhere in memory
    3. String is a reference type, char is a value type
    4. All values and reference types are developed by a basic class called Object
    5. Enumeration (enum) and struct (struct) are value types
    6. class, interface, array, delegate as reference type



                              &NB Sp                          ,         &NB Sp                                

      = =============================================================================================

                                 ,         &NB Sp                          ,         &NB Sp                         &NBSP return to directory

      = = ==========================================================================================

Basics of

[. NET object-oriented programming fundamentals] (3)-Data types

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.