The Global Nameless Namespace

   


None of the compilation units you have created from the examples shown so far in this book defined any namespaces explicitly. Classes and other types that are not defined inside an explicitly defined namespace are automatically set to belong to the same global nameless namespace. A type belonging to the global nameless namespace can be used in any other namespace merely by specifying its short name.

The previous examples in the book avoided explicit namespaces for two reasons; first, because the namespace concept was not yet fully introduced, and second, because the use of namespaces would be distractive and make the code samples longer. However, you should always organize your types by using namespaces.


   


C# Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 286
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net