Class Library:
is actually a bunch of class files, just do not see the source code of these classes, confidentiality is good.
Advantages: Good confidentiality
Cons: If this method is not good, the user cannot change it by themselves.
Most of them are DLL files. To use: Refer to Right-click, add Reference, browse, select to the appropriate DLL file, OK. Then add the "using namespace name" at the beginning
Commissioned:
A delegate can be understood as a pointer to a function.
Key words: Delegate
Declaration: public delegate int Firstdel (int a, int b);
To create a delegate variable:
Firstdel name = The same method as this delegate type;
In the class program, declare:
public delegate int Firstdel (int a, int b);
In the main function:
Jiajian JJ = new Jiajian (); Firstdel del = JJ. Jia; Console.WriteLine (Del (10,20));
IS and as operators:
is: Determine whether an object is a type
object is type name
Is this type returns TRUE, not this type returns false
As: Converts an object to a type, and if the conversion is unsuccessful, it assigns a null to the object without error.
Generic collection list<t>
Combines the benefits of collections and arrays
A set of fixed data types, not fixed lengths
Use:
Add at the beginning:
Using system.collections;using System.Collections.Generic;
In the main function:
list<string> slist = new list<string> (); Slist. ADD ("AAA"); Slist. ADD ("BBB"); String a = Slist[0]; list<int> ilist = new list<int> (); IList. ADD (1); IList. ADD (2); list<jiajian> jlist = new list<jiajian> ();
Universal variables:
Var
Dynamic
var bb = "AAA"; var cc = new Random (); var dd = new list<jiajian> (); Dynamic EE = "AAA"; Dynamic FF = new Random (); Dynamic GG = new list<random> ();
Object-oriented-class library, delegate, is and as operator, generic collection