The full name of the use class:
sb = new ();
The above writing method is very cumbersome, and the namespace is introduced using using statement:
using ;
StringBuilder sb = new StringBuilder();
For compilers, namespaces are about appending some delimiter symbols to a type to make the name more unique.
C#'s using directive is optional and can be replaced by the full name of the type. The c#'s using directive is instructed to the compiler as
Each type is appended with a different prefix 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 which assembly, then load the assembly and operate on it.
The using directive for c# also supports another form that allows defining alias for a type or namespace:
using int = System.Int32;
int i = 0;
Namespace and assembly relationship:
Assembly is an implementation type file and is generated after compilation.
A namespace is a logical grouping of types.
Types in the same namespace can be defined in different assembly settings.
The same assembly may also contain multiple namespaces to group types.
The c# compiler may be more concerned with the namespace, and should determine the full name of the class for it, and then hand it over to the CLR.
CLR only cares about the assembly and will load the corresponding assembly through the full name of the class.
sb = new ();
The above writing method is very cumbersome, and the namespace is introduced using using statement:
using ;
StringBuilder sb = new StringBuilder();
For compilers, namespaces are about appending some delimiter symbols to a type to make the name more unique.
C#'s using directive is optional and can be replaced by the full name of the type. The c#'s using directive is instructed to the compiler as
Each type is appended with a different prefix 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 which assembly, then load the assembly and operate on it.
The using directive for c# also supports another form that allows defining alias for a type or namespace:
using int = System.Int32;
int i = 0;
Namespace and assembly relationship:
Assembly is an implementation type file and is generated after compilation.
A namespace is a logical grouping of types.
Types in the same namespace can be defined in different assembly settings.
The same assembly may also contain multiple namespaces to group types.
The c# compiler may be more concerned with the namespace, and should determine the full name of the class for it, and then hand it over to the CLR.
CLR only cares about the assembly and will load the corresponding assembly through the full name of the class.