C# Basic Concepts—Fully Qualified Names
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:Articles |
| C# Articles |
| © 2006 Pearson Education, Inc. |
Fully Qualified Names
Every namespace and type has a fully qualified name, which uniquely identifies the namespace or type amongst all others. The fully qualified name of a namespace or type N is determined as follows.
- If
Nis a member of the global namespace, its fully qualified name isN.
- Otherwise, its fully qualified name is
S.N, whereSis the fully qualified name of the namespace or type in whichNis declared.
In other words, the fully qualified name of N is the complete hierarchical path of identifiers that lead to N, starting from the global namespace. Because every member of a namespace or type must have a unique name, it follows that the fully qualified name of a namespace or type is always unique.
The following example shows several namespace and type declarations along with their associated fully qualified names.
class A {} // A namespace X // X { class B // X.B { class C {} // X.B.C } namespace Y // X.Y { class D {} // X.Y.D } } namespace X.Y // X.Y { class E {} // X.Y.E }
|

