O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

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

Namespaces and Assemblies

Namespaces allow for the logical grouping of related types, and developers typically use them to make it easier to locate a particular type. For example, the System.Collections namespace defines a bunch of collection types, and the System.IO namespace defines a bunch of types for performing I/O operations. Here’s some code that constructs a System.IO.FileStream object and a System.Collections.Queue object:

class App {
   static void Main() {
      System.IO.FileStream fs = new System.IO.FileStream(...);
      System.Collections.Queue q = new System.Collections.Queue();
   }
}

As you can see, the code is pretty verbose; it would be nice if there were some shorthand way to refer to the FileStream and Queue types to reduce typing. Fortunately, ...

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