[2020-01-05] internal C # program

1, if the beginning of the program comprises using System; instruction, can be used directly System classes and methods without fully defined.

For example: Console.WriteLine can be called directly, rather than System.Console.WriteLine

If the System class method called directly, but there is no use using System, it will error --- because this method can not be found which belong to the class

 

2, C # program may consist of one or more files. Each file can contain zero or more namespaces.

Namespace may comprise a class, structure, interfaces, enumerations, other delegate type, and other namespaces

3, C # identifier

Identifier is assigned to the type (class, interface, structure, delegate or enumeration), a member variable or name of the namespace, valid identifiers must follow these rules:

① identifier must begin with a letter or _

② Unicode identifier may comprise alphabetic characters, decimal numeric characters, Unicode characters are connected, a combination of Unicode character or to Unicode

Naming Conventions - use camelCased PascalCase

① interface names begin with a capital letter I

② Attribute Type Attribute ending with the word

③ enumerated type of non-labeled singular noun, plural noun used to mark

④ identifier should not contain two consecutive characters _, these names are reserved for the compiler-generated identifiers

 

Guess you like

Origin www.cnblogs.com/QQ-lala/p/12152040.html