Basic concepts of namespaces
1. It is a method that provides application code containers in. net. It can uniquely identify the code and its content.
2. Used as a way to classify items in. NET Framework.
Namespace Definition
Format: namespace <namespace name> {}
1. Use the namespace keyword to explicitly define the namespace for the code block in curly brackets.
2. By default, the C # code is included in the global namespace.
3. If you use a namespace name outside the namespace, you must enter a qualified name for the namespace.
4. The specified name contains all the layer information of the namespace.
5. specify the period (.) for different namespaces (.).
6. If the code in a namespace needs to use the name defined in another namespace, it must include references to the name.
Note: 1) In a namespace, you can use the namespace keyword to define a nested namespace. The nested namespace is referenced by its layer-level structure, and the hierarchy is distinguished by periods.
2) The name is uniquely defined by the namespace.
3) use the using keyword to access the namespace.
Example: using system;
4) use the using keyword to define the namespace alias.
Example: Using newnamespace = oldnamespace;
5) The using statement can be applied to the namespace containing them and the nested namespace contained in the namespace.
Example: Using levelone. leveltwo;
6) The using statement itself cannot access the name in another namespace. Unless the code in the namespace is linked to the project in some way, the code is defined in the source file of the project, or defined in other code linked to the project, otherwise, you cannot access the name contained in it.
This article from the "action is better than words" blog, please be sure to keep this source http://vikxiao.blog.51cto.com/9189404/1551227
Step by Step C # language [namespace]