C # Learning miscellaneous (1)

xiaoxiao2021-03-06  49

.NET technology learning notes: Because the project needs to start assault .Net, today mainly understands the C # syntax and .NET framework foundation, because there is Java development experience, it doesn't matter it, it is not very hard, I don't know how it will be like actual application. . Today's notes are divided into two parts, C # grammar miscellaneous (1) and .NET framework foundation (1), more messy:

C # Syntax Missing (1):

◎ In C #, the CHAR type declaration in the value type (Value) is actually a Unicode character type, the length is 16 bits, this ???????? and the language of Java, C are really big, So the C # does not default to convert the char type to an integer type and must be explicitted;

◎ In the C # value type, there is also a Struct type and ENUM type of traditional C language;

◎ Boxing and unboxing's basic syntax: ?? boxing: int J = 1; Object o = j; ?? unboxing: Object o = 1; int J = (int) O;

◎ Delegate: C # acts as a compensation loss of pointers;

◎ The more special way in the initialization array in C # ?? int [] A1 = new int [] {1, 2, 3}; ?? int [] a2 = new int =,] {1, 2, 3} , {4, 5, 6}}; ?? int [] [] A3 = new int [2] []; ?? a3 [0] = new int = {1, 2, 3}; ?? a3 [ 1] = new int [] {4, 5, 6};

◎ The modifier of C #, there are two modes: Abstract and Sealed; ?? Sealed class cannot be inherited, a class cannot be Sealed and Abstract;

◎ Member modifier for C # is used for modification methods and attributes; ?? Abstract, const, ?? Event: Specify a delegate that can be started by "event", ?? extern: used for modification methods, indicating that this method will be External execution, ?? Override, ?? readonly: used to modify the field, if a domain uses readonly, then this domain can only be repaired when initialization or constructor ?????????????? ?????? change, ?? Virtural: indicates that its modification method and attribute can be derived overloaded

◎ Access the modifier ?? public, protected, private, ?? Internal: It can only be accessed in the project ?? protected internal ?? Access modifornic Namespace

◎ ENUM's default access modifier: public, and this type does not allow other access modifiers, Class's default is private, can be used, ?? Interface defaults to public, not allowing other, ?? Struct defaults to Private, This type can also use public, private, internal to modify, ?? The default for the attributes and methods is private

◎ If IF (1) {...} cannot be used in C #, IF (TRUE) {...} should be used.

◎ In the Switch structure of the C #, each Case must be eternal BREK or other jump statements, otherwise the compile will report an error, this ????????? and Java, C, etc. have different differences: ?? 1, Goto Case Label; ?? 2, goto default; ◎ C # provides a foreach () program structure;

Too late, I will here. The .NET framework is backed up again.

Today, I spent 80 big dollars bought a "Spider-Man" model. I like this screen hero not only because of his heroic fearless, there is also the kindness of the kindness but a little lazy "boring egg", I feel that I am quite like. Let him learn, you can't make your honest people.

转载请注明原文地址:https://www.9cbs.com/read-117388.html

New Post(0)