Click here to Skip to main content
15,912,756 members

Comments by Hassan Y. Ansari (Top 1 by date)

Hassan Y. Ansari 29-Aug-19 11:14am View    
Thank you so much both of you for reply. But my question is different. Suppose I declare one namespace with the name "namespace1" and inside this I declare one class with the name "HelloWorld". After that If I want to use "HelloWorld" class in my project later on so I have to use "using namespace1" statement. When I do it then I will be able to use "HelloWorld" class without using fully qualified name.
Now if I declare one more namespace with the name "namespace2" under the declaration of "namespace1". When I use "using namespace1" statement, it should automatically give access to "namespace2" also as after including namespace1, I will be able to use "HelloWorld" class. Both "HelloWorld" class and "namespace2" is declared under "namespace1" so why it is allowing access to only "HelloWorld" class and not to "namespace2" namespace.