[. 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:
- Data types are divided into value types (Valuetype) and reference types (referencetype)
- Value types store the actual values, whereas reference types are references to values stored somewhere in memory
- String is a reference type, char is a value type
- All values and reference types are developed by a basic class called Object
- Enumeration (enum) and struct (struct) are value types
- 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