O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

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

Organizing Types in Namespaces

Simply stated, namespaces provide a way to establish a hierarchical naming scheme for types in .NET libraries and applications. At the language level, it’s possible to declare new namespaces containing various types. Besides providing namespaces, there’s also the act of using them, which is based on the concept of importing them in code.

One level below the language, the runtime doesn’t really know much about namespaces because types always are referred to by a fully qualified name. Where a full type name looks like System.Collections.Generic.List<int>, you can simply write List<int> if the containing namespace has been imported. In other words, using namespaces yields an abbreviation of type names.

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