O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required