Full name of the class used:
System. Text. StringBuilder sb = new System. Text. StringBuilder ();
The preceding method is cumbersome. Use the using statement to introduce the namespace:
Using System. Text;
StringBuilder sb = new StringBuilder ();
For the compiler, the namespace is to add some separator numbers for a type to make the name more unique.
The c # using command is optional and can be replaced by a complete name of the type. The c # using command indicates that the compiler is
Different prefixes are appended to each type to determine the full name of the match.
CLR does not know anything about the namespace. CLR knows the complete name of the class to lock the specific Assembly defined in, then loads the assembly, and operates on it.
The c # using command also supports another form, allowing you to define an alias for a type or namespace:
Using int = System. Int32;
Int I = 0;
Relationship between namespaces and assembly:
An assembly is an implementation-type file generated after compilation.
A namespace is a logical group of types.
The types in the same namespace can be defined in different programming sets.
The same Assembly may also contain multiple namespaces to group types.
C # The Compiler may be concerned with namespaces. It should determine the complete name of the class and then hand it over to CLR.
CLR only cares about the Assembly and loads the corresponding Assembly through the complete name of the class.