Glossary:
1. CLR --------- Common Language Runtime ------------ manages the public Language Runtime EnvironmentCode.
2. JIT --------- Just In Time ------------------------- instant compiler. Purpose: Compile the local code with the intermediate language during execution.
3. msil -------- Microsoft intermediate language ----- Microsoft intermediate language. During compilation, the compiler converts the code into an intermediate language and metadata.
4. namespace ---- equivalent to the package in Java)
1) origin:
Microsoft Internet platform strategy, released from 2000-6-22. NET Framework
2) features:
1. Fully supports XML and is closely connected to the Web
2. automatic collection of objects
3. Cross-language (from its virtual object system)
3 ). net Structure
1. Virtual Object System (VOS): Cross-language integration, Program personnel can select their preferred development language as long as they support it. net
2. Metadata -------------: a name for the type of descriptive code in Vos, which is automatically generated during compilation, works with Source Code in binary code files.
3. Common Language Specification (CLS)
4. Virtual Execution System (VES): running environment
4) helloworld
using system;
class helloworld {
static void main () {
consol. write ("Hello world! ");
}< BR >}
Note: The Source Code suffix is. CS.
5) data type (simple value type, structure type, enumeration type ):
1. Integer ---------- sbyte (all with S are signed), byte (0 to 255), short, ushort, Int, uint, long, ulong
2. boolean -------- bool (true, false)
3. Real Numbers ---------- float and double C # Add decimal types to facilitate financial and goods evaluate operations
4. The character ---------- char contains escape characters: \ ', \ '', and so on.
5. Structure Type ------ struct student {
Public string name;
Public float score;
}
6. Enumeration type ------ Enum weekday {Sunday; Monday; Tuesday; Wednesday; Thursday; Friday; Saturday };
6) data type (reference type): ---- the so-called reference type is: this type variable does not directly store the included value, but points to this value, that is, the address that stores the reference value.
1. Class: -------------- the object class is the base class of all classes.
2. string class ---------- sting S = "hello ";
3. Delegate ---- A) Description: C # removes the pointer concept. Of course, pointers can also be used, but it must be declared as unsafe.
B) Definition: Delegate int mydelegate (); ---- represents a function pointer prototype.
C) Use: mydelegate d = new mydelegate (class. Method)
D (); // then it is equivalent to dropping the function directly.
4. array -------------- a) Definition: int [] arr = new int [5]; // int [] arr = new int [5] {1, 2, 3, 4, 5 }//
Int [] iarr; --- Yi Wei
Int [,] iarr; ---- Erwei
Int [,] iarr; ---- Sanwei
7) boxing -- unboxing: used for conversion between value type, reference type, and object type.
1. Pack ------------- to implicitly convert a value type into an object type
Example: int I = 10;
Object OBJ = I; // implicit
Object OBJ = Object (I) // explicit
2. Unpack ------------- to convert an object type into a Value Type
Example: int I = 10;
Object OBJ = I;
Int J = (INT) OBJ;
8) Expression
1. Operator ----- A: unary operator ++, -- // B, binary operator +,-, *,/, % (remainder) // C, ternary operator y = (x> 10? 1-0)
2. Link character ----- = (equal )! = (Not equal)
3. As operator --- converts a value to a specified reference type. If the conversion fails, null is returned.
4. logical symbols --- & (and) | (OR )! (Not)
9) Process Control
1. If judgment structure -------- if (condition) {} else {};
2. swith switch structure ----- swith (expression ){
Case value 1: Do something; break;
Case value 2: Do something; break;
Default :.....
}
Note: You can use the Goto case value 1 instead of break to turn to // or goto default;
3. For Loop Structure ------- for (INT I = 0; I <= 10; I ++ ){...}
While loop ------- while (condition ){...};
Do... while loop --- do {...} while (condition)
10) Exception Handling
1. Structure 1 -------- try {...} catch (exception e) {...} // E. Message
2. Structure 2 -------- try {...} finally {...}
3. Structure 3 --------- try {...} catch (exception e) {...} finally {..}
4. Throw an exception:
A. --- throw new exception ("error message ");
B. ---- E = new exception ("error message ");
Throw;
11) class:
1. Class Modifier
A. Public ------ no access restriction.
B. Protected ---- protection class, which can be accessed by its class and its subclass.
C. Internal ----- can be accessed only by the class
D. Private ------ only applications and libraries in this package can access
E. Abstract ----- abstract class. instances cannot be created.
F. Sealed ------- sealed class, which cannot be inherited. // Seal/Si: l/sealed .. Seals
2. class member
Public Member, Private member, protected member, internal Member.
3. This reserved word
It is only used in constructors, class members, and class instances.
4. Member Constants
Public const int I = 10;
5. constructor:
A. the constructor is usually the same as the class name.
B. the constructor does not declare the return type.
C. The constructor is always public. If the constructor is private, the class cannot be used as an instance.
Example: Class
{
Public A (int I) {...}; // Constructor
}
6. destructor
A. The Destructor name is the same as the class name, but there is a wave in front of it ~ Symbol.
11) method:
1. modifiers: new, public, protected, internal, Private, static, virtual, sealed, override, abstract, and extern
Note: There is only one semicolon for the execution body of abstract and extern methods; that is, only declarations are not implemented.
2. Parameters
A. Value parameter ------- without any modifier: the copied value is passed. Any modification does not affect the original parameter.
B. reference parameter ------ use ref as modifier: the address of the value is passed,
C. output parameter ------ use the out modifier. The difference between the output parameter and the ref parameter is that you do not need to initialize this parameter before calling the function.
D. array parameter ------ modified with Params:
NOTE 1: The array parameter must be at the end of the parameter table.
Note 2: The parameter can only be a unique array
NOTE 3: array parameters do not have ref or out Modifiers
3. Method overload ------- the class contains methods of the same name, but the parameters must be different.
4. Operator Overloading -----
12) domain and attribute
1. Domain: it is a member variable. Modifier: public, protected, internal, Private... Static static domain.
Read-Only domain: public static readonly double Pi = 3.1415926
2. attribute: Declaration --- attributes modifier type name
Read attribute: Get write set
13) event and index indicators